DEPRECATED(2)

NAME
none - deprecated system calls

SYNOPSIS
Deprecated system calls

DESCRIPTION
This man page mentions those system calls which are deprecated for the current architecture.

  The list
access(2), alarm(2), bdflush(2), chmod(2), chown(2), creat(2), dup2(2), epoll_create(2), epoll_wait(2), eventfd(2), fork(2), futimesat(2), getdents(2), getpgrp(2), inotify_init(2), lchown(2), link(2), mkdir(2), mknod(2), open(2), pause(2), pipe(2), poll(2), readlink(2), recv(2), rename(2), rmdir(2), select(2), send(2), signalfd(2), symlink(2), sysctl(2), time(2), umount(2), unlink(2), uselib(2), ustat(2), utime(2), utimes(2), vfork(2), wait4(2).

  Replacement for deprecated syscalls

Deprecated |  | Replacement
access(2) |  | faccessat(2)
alarm(2) |  | getitimer(2), setitimer(2)
bdflush(2) |  | no replacement, see kernel pdflush thread
chmod(2) |  | fchmodat(2)
chown(2) |  | fchownat(2)
creat(2) |  | open(2) with O_CREAT flag
dup2(2) |  | dup3(2) with flags set to 0
epoll_create(2) |  | epoll_create1(2), see also epoll_ctl(2))
epoll_wait(2) |  | epoll_pwait(2), see also epoll_ctl(2))
eventfd(2) |  | eventfd2(2)
fork(2) |  | equivalent to a call to clone(2) specifying flags as just SIGCHLD
futimesat(2) |  | utimensat(2)
getdents(2) |  | getdents64(2), or readdir(3) for glibc wrapper
getpgrp(2) |  | getpgid(2)
inotify_init(2) |  | inotify_init1(2)
lchown(2) |  | fchownat(2) with AT_SYMLINK_NOFOLLOW flag
link(2) |  | linkat(2)
mkdir(2) |  | mkdirat(2)
mknod(2) |  | mknodat(2)
open(2) |  | openat(2)
pause(2) |  | sigsuspend(2), ppoll(2), or pselect(2)
pipe(2) |  | pipe2(2)
poll(2) |  | ppoll(2)
readlink(2) |  | readlinkat(2)
recv(2) |  | recvfrom(2) with a NULL src_addr argument
rename(2) |  | renameat(2)
rmdir(2) |  | unlinkat(2) with AT_REMOVEDIR flag
select(2) |  | pselect(2)
send(2) |  | sendto(2) with a NULL dest_addr
signalfd(2) |  | signalfd4(2)
symlink(2) |  | symlinkat(2)
sysctl(2) |  | no replacement, use /proc/sys filesystem
time(2) |  | gettimeofday(2), to improve performance, the system call can be avoided by mapping the time into a vDSO segment
umount(2) |  | umount2(2)
unlink(2) |  | unlinkat(2)
uselib(2) |  | no replacement, see dlopen(3) and EXAMPLE section of this manual page
ustat(2) |  | statfs(2)
utime(2) |  | utimensat(2)
utimes(2) |  | utimensat(2)
vfork(2) |  | equivalent to calling clone(2) with flags specified as CLONE_VM | CLONE_VFORK | SIGCHLD
wait4(2) |  | waitpid(2) or waitid(2)

EXAMPLES

  uselib(2) syscall example
Running strace on the following code in Red Hat Enterprise Linux Server for ARM on aarch64 along with RHEL 7 on x86_64, ppc64, and s390x outputs:

    #include <unistd.h>
    int main(void)
    {
        uselib("/usr/lib64/libtinfo.so.5.9");
    }
On aarch64:
    # uname -r
    3.17.0-0.rc6.45.sa2.aarch64
    # strace -e trace=uselib ./a.out
    +++ exited with 255 +++
On x86_64:
    # uname -r
    3.10.0-123.8.1.el7.x86_64
    # strace -e trace=uselib ./a.out
    uselib("/usr/lib64/libtinfo.so.5")      = -1 ENOSYS (Function not implemented)
    +++ exited with 255 +++
On ppc64:
    # uname -r
    3.10.0-123.el7.ppc64
    # strace -e trace=uselib ./a.out
    uselib("/usr/lib64/libtinfo.so.5.9")    = -1 ENOEXEC (Exec format error)
    +++ exited with 32 +++
On s390x:
    # uname -r
    3.10.0-123.el7.s390x
    # strace -e trace=uselib ./a.out
    uselib("/usr/lib64/libtinfo.so.5.9")    = -1 ENOEXEC (Exec format error)
    +++ exited with 160 +++