[PATCH v2 00/46] Support for cut-down Linux syscalls

Markos Chandras markos.chandras at gmail.com
Mon Nov 26 14:23:42 UTC 2012


From: Markos Chandras <markos.chandras at imgtec.com>

Hi,

This is the v2 of the patchset I sent on the 13th of November 2012[1].

Changes since v1:

- drop dup3 patch and cherry-pick the dup3 patches from master branch[2]
- Fix dup2 to check if file descriptors are the same before calling
dup3[3]
- Make vfork act as fork() instead of clone()[4]
- Coding style fixes (char* foo -> char *foo, ! defined -> !defined etc)[5][6]
- Add missing libc_hidden_{proto,def} for internal calls.[7]
- Fix libc stubs for deprecated syscalls that may be implemented using the newer
ones (such as fstatfs, ustat, sendfile, fork, inotify_init, epoll_wait,
epoll_create)[8]
- Revert __IPC_64 patch and add a simple #ifndef/#endif macro to allow
architectures to override its value in the uClibc_arch_features.h[9]
- Revert logic for ARCH_HAS_NO_DEPRECATED_SYSCALLS.[10]

I will only post the patches that changed significantly since the first revision.

All patches are based on the 0.9.33 branch and are available in the
following git repository:
https://github.com/hwoarang/uClibc
git://github.com/hwoarang/uClibc.git 0.9.33-syscalls-for-upstream

[1]: http://lists.uclibc.org/pipermail/uclibc/2012-November/047110.html
[2]: http://lists.uclibc.org/pipermail/uclibc/2012-November/047175.html
[3]: http://lists.uclibc.org/pipermail/uclibc/2012-November/047160.html
[4]: http://lists.uclibc.org/pipermail/uclibc/2012-November/047161.html
[5]: http://lists.uclibc.org/pipermail/uclibc/2012-November/047173.html
[6]: http://lists.uclibc.org/pipermail/uclibc/2012-November/047172.html
[7]: http://lists.uclibc.org/pipermail/uclibc/2012-November/047171.html
[8]: http://lists.uclibc.org/pipermail/uclibc/2012-November/047177.html
[9]: http://lists.uclibc.org/pipermail/uclibc/2012-November/047162.html
[10]: http://lists.uclibc.org/pipermail/uclibc/2012-November/047179.html

Markos Chandras (44):
  dup2: Use dup3 if arch does not have the dup2 syscall
  chmod: Use fchmodat if arch does not have the chmod syscall
  access: Use faccessat if arch does not have the access syscall
  link: Use linkat if arch does not have the link syscall
  unlink: Use unlinkat if arch does not have the unlink syscall
  mknod: Use mknodat if arch does not have the mknod syscall
  chown: Use fchownat if arch does not have the chown syscall
  rmdir: Use unlinkat if arch does not have the rmdir syscall
  lchown: Use fchownat if arch does not have the lchown syscall
  mkdir: Use mkdirat if arch does not have the mkdir syscall
  rename: Use renameat if arch does not have the rename syscall
  readlink: Use readlinkat if arch does not have the readlink syscall
  symlink: Use symlinkat if arch does not have the symlink syscall
  utimes: Use utimensat if arch does not have the utimes syscall
  pipe: Use pipe2 if arch does not have the pipe syscall
  epoll: Use epoll_create1 if arch does not have the epoll_create
    syscall
  epoll: Use epoll_pwait if arch does not have the epoll_wait syscall
  inotify_init: Use inotify_init1 if inotify_init syscall is not
    defined
  utime: Use utimensat if arch does not have the utime syscall
  vfork: Use fork if arch does not have the vfork syscall
  fork: Use clone if arch does not have the fork syscall
  ftruncate: Use ftruncate64 if arch does not have the ftruncate
    syscall
  truncate: Use truncate64 if arch does not have the truncate syscall
  sendfile: Use sendfile64 if arch does not have the sendfile syscall
  getdents: Use getdents64 if arch does not have the getdents syscall
  statfs: Use statfs64 if arch does not have the statfs syscall
  fstatat: Use newfstatat only for 64-bit operations
  fstatat64: Use newfstatat only for 64-bit operations
  stat64: Use fstatat64 if arch does not have the stat64 syscall
  lstat: Use fstatat64 if arch does not have the lstat syscall
  lstat64: Use fstatat64 if arch does not have the lstat64 syscall
  ustat: Add ustat stub for arches that don't have the ustat system
    call
  stat: Use fstatat64 if arch does not have the stat syscall
  fstat: Use fstat64() if arch does not have the fstat syscall
  fstatfs: Add __libc_fstatfs wrapper
  fstatfs64: Prefer fstatfs64 system call instead of __libc_fstatfs
  fcntl: Use fcntl64 is arch does not have the fcntl syscall
  openat: Add openat syscall for NPTL
  open64: Use openat if arch does not have the open syscall
  not-cancel.h: Use openat if arch does not have the open syscall
  open-wrapper: Use a wrapper for the open() symbol
  ldso: Use newer syscalls if arch does not have the deprecated
    syscalls
  libc/ipc: Allow architectures to define their own __IPC_64 macro
  Config.in: Introduce symbol for arches with deprecated syscalls

Mike Frysinger (2):
  libc/sysdeps: add dup3 syscall wrapper
  libc/sysdeps: dup3: check for __NR_dup3 since older kernels/arches
    lack it

 extra/Configs/Config.alpha                         |  1 +
 extra/Configs/Config.arm                           |  1 +
 extra/Configs/Config.avr32                         |  1 +
 extra/Configs/Config.bfin                          |  1 +
 extra/Configs/Config.c6x                           |  1 +
 extra/Configs/Config.cris                          |  1 +
 extra/Configs/Config.e1                            |  1 +
 extra/Configs/Config.frv                           |  1 +
 extra/Configs/Config.h8300                         |  1 +
 extra/Configs/Config.hppa                          |  1 +
 extra/Configs/Config.i386                          |  1 +
 extra/Configs/Config.i960                          |  1 +
 extra/Configs/Config.ia64                          |  1 +
 extra/Configs/Config.in                            |  2 +
 extra/Configs/Config.in.arch                       |  8 ++
 extra/Configs/Config.m68k                          |  1 +
 extra/Configs/Config.microblaze                    |  1 +
 extra/Configs/Config.mips                          |  1 +
 extra/Configs/Config.nios                          |  1 +
 extra/Configs/Config.nios2                         |  1 +
 extra/Configs/Config.powerpc                       |  1 +
 extra/Configs/Config.sh                            |  1 +
 extra/Configs/Config.sh64                          |  1 +
 extra/Configs/Config.sparc                         |  1 +
 extra/Configs/Config.v850                          |  1 +
 extra/Configs/Config.vax                           |  1 +
 extra/Configs/Config.x86_64                        |  1 +
 extra/Configs/Config.xtensa                        |  1 +
 include/stdio.h                                    |  1 +
 include/sys/sendfile.h                             |  1 +
 include/sys/stat.h                                 |  3 +
 include/sys/statfs.h                               |  1 +
 include/unistd.h                                   | 13 ++++
 ldso/include/dl-syscall.h                          | 88 ++++++++++++++++++++++
 ldso/include/ldso.h                                |  4 +
 libc/misc/statfs/fstatfs64.c                       | 14 ++++
 libc/misc/sysvipc/ipc.h                            |  2 +
 libc/sysdeps/linux/common/Makefile.in              |  3 +-
 libc/sysdeps/linux/common/__syscall_fcntl.c        | 57 +++++++++++++-
 libc/sysdeps/linux/common/__syscall_fcntl64.c      |  5 ++
 libc/sysdeps/linux/common/access.c                 | 10 +++
 libc/sysdeps/linux/common/chmod.c                  |  9 +++
 libc/sysdeps/linux/common/chown.c                  |  9 +++
 libc/sysdeps/linux/common/dup2.c                   | 17 +++++
 libc/sysdeps/linux/common/dup3.c                   | 15 ++++
 libc/sysdeps/linux/common/epoll.c                  | 30 ++++++--
 libc/sysdeps/linux/common/faccessat.c              |  1 +
 libc/sysdeps/linux/common/fchmodat.c               |  1 +
 libc/sysdeps/linux/common/fchownat.c               |  1 +
 libc/sysdeps/linux/common/fork.c                   | 17 ++++-
 libc/sysdeps/linux/common/fstat.c                  | 20 ++++-
 libc/sysdeps/linux/common/fstatat.c                |  2 +-
 libc/sysdeps/linux/common/fstatat64.c              |  3 +-
 libc/sysdeps/linux/common/fstatfs.c                | 43 ++++++++++-
 libc/sysdeps/linux/common/ftruncate.c              |  9 +++
 libc/sysdeps/linux/common/getdents.c               |  4 +-
 libc/sysdeps/linux/common/inotify.c                | 14 +++-
 libc/sysdeps/linux/common/lchown.c                 | 11 +++
 libc/sysdeps/linux/common/link.c                   |  9 +++
 libc/sysdeps/linux/common/linkat.c                 |  1 +
 libc/sysdeps/linux/common/lstat.c                  | 17 ++++-
 libc/sysdeps/linux/common/lstat64.c                | 14 +++-
 libc/sysdeps/linux/common/mkdir.c                  |  8 ++
 libc/sysdeps/linux/common/mkdirat.c                |  1 +
 libc/sysdeps/linux/common/mknod.c                  |  8 ++
 libc/sysdeps/linux/common/not-cancel.h             |  7 ++
 libc/sysdeps/linux/common/open-wrapper.c           | 77 +++++++++++++++++++
 libc/sysdeps/linux/common/open.c                   | 39 ----------
 libc/sysdeps/linux/common/open64.c                 |  9 ++-
 libc/sysdeps/linux/common/pipe.c                   |  8 ++
 libc/sysdeps/linux/common/readlink.c               |  8 ++
 libc/sysdeps/linux/common/readlinkat.c             |  1 +
 libc/sysdeps/linux/common/rename.c                 |  9 ++-
 libc/sysdeps/linux/common/renameat.c               |  1 +
 libc/sysdeps/linux/common/rmdir.c                  |  8 ++
 libc/sysdeps/linux/common/sendfile.c               | 44 ++++++++++-
 libc/sysdeps/linux/common/sendfile64.c             |  1 +
 libc/sysdeps/linux/common/stat.c                   | 17 ++++-
 libc/sysdeps/linux/common/stat64.c                 | 16 +++-
 libc/sysdeps/linux/common/statfs.c                 | 53 ++++++++++++-
 libc/sysdeps/linux/common/stubs.c                  | 19 +++--
 libc/sysdeps/linux/common/symlink.c                | 13 ++++
 libc/sysdeps/linux/common/symlinkat.c              |  1 +
 libc/sysdeps/linux/common/truncate.c               |  9 +++
 libc/sysdeps/linux/common/truncate64.c             |  2 +-
 libc/sysdeps/linux/common/unlink.c                 |  8 ++
 libc/sysdeps/linux/common/unlinkat.c               |  1 +
 libc/sysdeps/linux/common/ustat.c                  |  2 +
 libc/sysdeps/linux/common/utime.c                  | 22 +++++-
 libc/sysdeps/linux/common/utimes.c                 | 23 +++++-
 libc/sysdeps/linux/common/vfork.c                  | 16 +++-
 .../linuxthreads.old/sysdeps/pthread/not-cancel.h  |  9 +++
 libpthread/linuxthreads.old/wrapsyscall.c          |  3 +-
 .../linuxthreads/sysdeps/pthread/not-cancel.h      |  9 +++
 .../sysdeps/unix/sysv/linux/Makefile.commonarch    |  4 +-
 .../nptl/sysdeps/unix/sysv/linux/not-cancel.h      |  9 +++
 libpthread/nptl/sysdeps/unix/sysv/linux/open.S     |  8 +-
 libpthread/nptl/sysdeps/unix/sysv/linux/openat.S   | 22 ++++++
 98 files changed, 893 insertions(+), 87 deletions(-)
 create mode 100644 libc/sysdeps/linux/common/dup3.c
 create mode 100644 libc/sysdeps/linux/common/open-wrapper.c
 delete mode 100644 libc/sysdeps/linux/common/open.c
 create mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/openat.S

-- 
1.8.0




More information about the uClibc mailing list