diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs index 557b6465d53a..940d3077cbf1 100644 --- a/src/fuchsia/mod.rs +++ b/src/fuchsia/mod.rs @@ -3507,7 +3507,6 @@ extern "C" { pub fn free(p: *mut c_void); pub fn abort() -> !; pub fn exit(status: c_int) -> !; - pub fn _exit(status: c_int) -> !; pub fn atexit(cb: extern "C" fn()) -> c_int; pub fn system(s: *const c_char) -> c_int; pub fn getenv(s: *const c_char) -> *mut c_char; @@ -3619,7 +3618,6 @@ extern "C" { pub fn openat(dirfd: c_int, pathname: *const c_char, flags: c_int, ...) -> c_int; pub fn fchmodat(dirfd: c_int, pathname: *const c_char, mode: mode_t, flags: c_int) -> c_int; - pub fn fchown(fd: c_int, owner: crate::uid_t, group: crate::gid_t) -> c_int; pub fn fchownat( dirfd: c_int, pathname: *const c_char, @@ -3651,61 +3649,10 @@ extern "C" { pub fn symlinkat(target: *const c_char, newdirfd: c_int, linkpath: *const c_char) -> c_int; pub fn unlinkat(dirfd: c_int, pathname: *const c_char, flags: c_int) -> c_int; - pub fn access(path: *const c_char, amode: c_int) -> c_int; - pub fn alarm(seconds: c_uint) -> c_uint; - pub fn chdir(dir: *const c_char) -> c_int; - pub fn chown(path: *const c_char, uid: uid_t, gid: gid_t) -> c_int; - pub fn lchown(path: *const c_char, uid: uid_t, gid: gid_t) -> c_int; - pub fn close(fd: c_int) -> c_int; - pub fn dup(fd: c_int) -> c_int; - pub fn dup2(src: c_int, dst: c_int) -> c_int; - pub fn execl(path: *const c_char, arg0: *const c_char, ...) -> c_int; - pub fn execle(path: *const c_char, arg0: *const c_char, ...) -> c_int; - pub fn execlp(file: *const c_char, arg0: *const c_char, ...) -> c_int; - pub fn execv(prog: *const c_char, argv: *const *mut c_char) -> c_int; - pub fn execve(prog: *const c_char, argv: *const *mut c_char, envp: *const *mut c_char) - -> c_int; - pub fn execvp(c: *const c_char, argv: *const *mut c_char) -> c_int; - pub fn fork() -> pid_t; - pub fn fpathconf(filedes: c_int, name: c_int) -> c_long; - pub fn getcwd(buf: *mut c_char, size: size_t) -> *mut c_char; - pub fn getegid() -> gid_t; - pub fn geteuid() -> uid_t; - pub fn getgid() -> gid_t; - pub fn getgroups(ngroups_max: c_int, groups: *mut gid_t) -> c_int; - pub fn getlogin() -> *mut c_char; - pub fn getopt(argc: c_int, argv: *const *mut c_char, optstr: *const c_char) -> c_int; - pub fn getpgid(pid: pid_t) -> pid_t; - pub fn getpgrp() -> pid_t; - pub fn getpid() -> pid_t; - pub fn getppid() -> pid_t; - pub fn getuid() -> uid_t; - pub fn isatty(fd: c_int) -> c_int; - pub fn link(src: *const c_char, dst: *const c_char) -> c_int; - pub fn lseek(fd: c_int, offset: off_t, whence: c_int) -> off_t; - pub fn pathconf(path: *const c_char, name: c_int) -> c_long; - pub fn pause() -> c_int; - pub fn pipe(fds: *mut c_int) -> c_int; pub fn posix_memalign(memptr: *mut *mut c_void, align: size_t, size: size_t) -> c_int; - pub fn read(fd: c_int, buf: *mut c_void, count: size_t) -> ssize_t; - pub fn rmdir(path: *const c_char) -> c_int; - pub fn seteuid(uid: uid_t) -> c_int; - pub fn setegid(gid: gid_t) -> c_int; - pub fn setgid(gid: gid_t) -> c_int; - pub fn setpgid(pid: pid_t, pgid: pid_t) -> c_int; - pub fn setsid() -> pid_t; - pub fn setuid(uid: uid_t) -> c_int; - pub fn sleep(secs: c_uint) -> c_uint; pub fn nanosleep(rqtp: *const timespec, rmtp: *mut timespec) -> c_int; - pub fn tcgetpgrp(fd: c_int) -> pid_t; - pub fn tcsetpgrp(fd: c_int, pgrp: crate::pid_t) -> c_int; - pub fn ttyname(fd: c_int) -> *mut c_char; - pub fn unlink(c: *const c_char) -> c_int; pub fn wait(status: *mut c_int) -> pid_t; pub fn waitpid(pid: pid_t, status: *mut c_int, options: c_int) -> pid_t; - pub fn write(fd: c_int, buf: *const c_void, count: size_t) -> ssize_t; - pub fn pread(fd: c_int, buf: *mut c_void, count: size_t, offset: off_t) -> ssize_t; - pub fn pwrite(fd: c_int, buf: *const c_void, count: size_t, offset: off_t) -> ssize_t; pub fn umask(mask: mode_t) -> mode_t; pub fn utime(file: *const c_char, buf: *const utimbuf) -> c_int; @@ -3732,15 +3679,9 @@ extern "C" { pub fn lstat(path: *const c_char, buf: *mut stat) -> c_int; - pub fn fsync(fd: c_int) -> c_int; - pub fn setenv(name: *const c_char, val: *const c_char, overwrite: c_int) -> c_int; pub fn unsetenv(name: *const c_char) -> c_int; - pub fn symlink(path1: *const c_char, path2: *const c_char) -> c_int; - - pub fn ftruncate(fd: c_int, length: off_t) -> c_int; - pub fn signal(signum: c_int, handler: sighandler_t) -> sighandler_t; pub fn realpath(pathname: *const c_char, resolved: *mut c_char) -> *mut c_char; @@ -3848,7 +3789,6 @@ extern "C" { pub fn mknod(pathname: *const c_char, mode: mode_t, dev: crate::dev_t) -> c_int; pub fn uname(buf: *mut crate::utsname) -> c_int; - pub fn gethostname(name: *mut c_char, len: size_t) -> c_int; pub fn getservbyname(name: *const c_char, proto: *const c_char) -> *mut servent; pub fn getprotobyname(name: *const c_char) -> *mut protoent; pub fn getprotobynumber(proto: c_int) -> *mut protoent; @@ -3875,8 +3815,6 @@ extern "C" { pub fn statvfs(path: *const c_char, buf: *mut statvfs) -> c_int; pub fn fstatvfs(fd: c_int, buf: *mut statvfs) -> c_int; - pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: size_t) -> ssize_t; - pub fn sigemptyset(set: *mut sigset_t) -> c_int; pub fn sigaddset(set: *mut sigset_t, signum: c_int) -> c_int; pub fn sigfillset(set: *mut sigset_t) -> c_int; @@ -3888,10 +3826,6 @@ extern "C" { pub fn timegm(tm: *mut crate::tm) -> time_t; - pub fn getsid(pid: pid_t) -> pid_t; - - pub fn sysconf(name: c_int) -> c_long; - pub fn mkfifo(path: *const c_char, mode: mode_t) -> c_int; pub fn pselect( @@ -3989,8 +3923,6 @@ extern "C" { infop: *mut crate::siginfo_t, options: c_int, ) -> c_int; - pub fn setreuid(ruid: crate::uid_t, euid: crate::uid_t) -> c_int; - pub fn setregid(rgid: crate::gid_t, egid: crate::gid_t) -> c_int; pub fn getresuid( ruid: *mut crate::uid_t, euid: *mut crate::uid_t, diff --git a/src/new/aix/unistd.rs b/src/new/aix/unistd.rs index 8d55ee582331..2d252b5c39a9 100644 --- a/src/new/aix/unistd.rs +++ b/src/new/aix/unistd.rs @@ -1,6 +1,73 @@ //! Header: `unistd.h` pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + confstr, + dup, + dup2, + execl, + execle, + execlp, + execv, + execve, + execvp, + fchdir, + fchown, + fork, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + gethostname, + getlogin, + getopt, + getpgid, + getpgrp, + getpid, + getppid, + getsid, + getuid, + isatty, + lchown, + link, + lockf, + lseek, + nice, + pathconf, + pause, + pipe, + pread, + pwrite, + read, + readlink, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setregid, + setreuid, + setsid, + setuid, + sleep, + symlink, + sysconf, + tcgetpgrp, + tcsetpgrp, + truncate, + ttyname, + ttyname_r, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/new/apple_libc/unistd.rs b/src/new/apple_libc/unistd.rs index 8d55ee582331..2d252b5c39a9 100644 --- a/src/new/apple_libc/unistd.rs +++ b/src/new/apple_libc/unistd.rs @@ -1,6 +1,73 @@ //! Header: `unistd.h` pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + confstr, + dup, + dup2, + execl, + execle, + execlp, + execv, + execve, + execvp, + fchdir, + fchown, + fork, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + gethostname, + getlogin, + getopt, + getpgid, + getpgrp, + getpid, + getppid, + getsid, + getuid, + isatty, + lchown, + link, + lockf, + lseek, + nice, + pathconf, + pause, + pipe, + pread, + pwrite, + read, + readlink, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setregid, + setreuid, + setsid, + setuid, + sleep, + symlink, + sysconf, + tcgetpgrp, + tcsetpgrp, + truncate, + ttyname, + ttyname_r, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/new/bionic_libc/unistd.rs b/src/new/bionic_libc/unistd.rs index 8d55ee582331..83220525f297 100644 --- a/src/new/bionic_libc/unistd.rs +++ b/src/new/bionic_libc/unistd.rs @@ -1,6 +1,72 @@ //! Header: `unistd.h` pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + dup, + dup2, + execl, + execle, + execlp, + execv, + execve, + execvp, + fchdir, + fchown, + fork, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + gethostname, + getlogin, + getopt, + getpgid, + getpgrp, + getpid, + getppid, + getsid, + getuid, + isatty, + lchown, + link, + lockf, + lseek, + nice, + pathconf, + pause, + pipe, + pread, + pwrite, + read, + readlink, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setregid, + setreuid, + setsid, + setuid, + sleep, + symlink, + sysconf, + tcgetpgrp, + tcsetpgrp, + truncate, + ttyname, + ttyname_r, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/new/common/posix/unistd.rs b/src/new/common/posix/unistd.rs index 0c02cbaa699f..1ff5cefbe502 100644 --- a/src/new/common/posix/unistd.rs +++ b/src/new/common/posix/unistd.rs @@ -3,7 +3,255 @@ //! use crate::prelude::*; +use crate::{ + gid_t, + off_t, + pid_t, + uid_t, +}; pub const STDIN_FILENO: c_int = 0; pub const STDOUT_FILENO: c_int = 1; pub const STDERR_FILENO: c_int = 2; + +extern "C" { + pub fn access(path: *const c_char, amode: c_int) -> c_int; + pub fn alarm(seconds: c_uint) -> c_uint; + pub fn chdir(dir: *const c_char) -> c_int; + pub fn chown(path: *const c_char, uid: uid_t, gid: gid_t) -> c_int; + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "close$NOCANCEL$UNIX2003" + )] + #[cfg_attr( + all(target_os = "macos", target_arch = "x86_64"), + link_name = "close$NOCANCEL" + )] + pub fn close(fd: c_int) -> c_int; + + #[cfg(not(any(target_os = "android", target_os = "vxworks")))] + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "confstr$UNIX2003" + )] + #[cfg_attr(target_os = "solaris", link_name = "__confstr_xpg7")] + pub fn confstr(name: c_int, buf: *mut c_char, len: size_t) -> size_t; + + // Not provided: crypt + // Not provided: ctermid + + pub fn dup(fd: c_int) -> c_int; + pub fn dup2(src: c_int, dst: c_int) -> c_int; + + // Not provided: encrypt + + #[cfg(not(target_os = "vxworks"))] + pub fn execl(path: *const c_char, arg0: *const c_char, ...) -> c_int; + + #[cfg(not(target_os = "vxworks"))] + pub fn execle(path: *const c_char, arg0: *const c_char, ...) -> c_int; + + #[cfg(not(target_os = "vxworks"))] + pub fn execlp(file: *const c_char, arg0: *const c_char, ...) -> c_int; + + #[cfg(not(target_os = "vxworks"))] + pub fn execv(prog: *const c_char, argv: *const *mut c_char) -> c_int; + + #[cfg(not(target_os = "vxworks"))] + pub fn execve(prog: *const c_char, argv: *const *mut c_char, envp: *const *mut c_char) + -> c_int; + + #[cfg(not(target_os = "vxworks"))] + pub fn execvp(c: *const c_char, argv: *const *mut c_char) -> c_int; + + pub fn _exit(status: c_int) -> !; + + pub fn fchown(fd: c_int, owner: uid_t, group: gid_t) -> c_int; + + #[cfg(not(target_os = "fuchsia"))] + pub fn fchdir(dirfd: c_int) -> c_int; + + // Support for fdatasync varies + + #[cfg(not(target_os = "vxworks"))] + pub fn fork() -> pid_t; + + pub fn fpathconf(filedes: c_int, name: c_int) -> c_long; + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "fsync$UNIX2003" + )] + pub fn fsync(fd: c_int) -> c_int; + + #[cfg_attr(gnu_file_offset_bits64, link_name = "ftruncate64")] + pub fn ftruncate(fd: c_int, length: off_t) -> c_int; + + pub fn getcwd(buf: *mut c_char, size: size_t) -> *mut c_char; + pub fn getegid() -> gid_t; + pub fn geteuid() -> uid_t; + pub fn getgid() -> gid_t; + pub fn getgroups(ngroups_max: c_int, groups: *mut gid_t) -> c_int; + // Support for gethostid varies + + #[cfg(not(target_os = "espidf"))] + pub fn gethostname(name: *mut c_char, len: size_t) -> c_int; + + #[cfg_attr(target_os = "illumos", link_name = "getloginx")] + pub fn getlogin() -> *mut c_char; + + // Support for getlogin_r varies + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "getopt$UNIX2003" + )] + pub fn getopt(argc: c_int, argv: *const *mut c_char, optstr: *const c_char) -> c_int; + + #[cfg(not(target_os = "vxworks"))] + pub fn getpgid(pid: pid_t) -> pid_t; + + #[cfg(not(target_os = "vxworks"))] + pub fn getpgrp() -> pid_t; + pub fn getpid() -> pid_t; + pub fn getppid() -> pid_t; + + #[cfg(not(any(target_os = "redox", target_os = "vxworks")))] + pub fn getsid(pid: pid_t) -> pid_t; + pub fn getuid() -> uid_t; + + pub fn isatty(fd: c_int) -> c_int; + + #[cfg(not(target_os = "vxworks"))] + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "lchown$UNIX2003" + )] + pub fn lchown(path: *const c_char, uid: uid_t, gid: gid_t) -> c_int; + + #[cfg_attr(target_os = "solaris", link_name = "__link_xpg4")] + pub fn link(src: *const c_char, dst: *const c_char) -> c_int; + + #[cfg(not(any(target_os = "fuchsia", target_os = "vxworks")))] + #[cfg_attr(gnu_file_offset_bits64, link_name = "lockf64")] + pub fn lockf(fd: c_int, cmd: c_int, len: off_t) -> c_int; + + #[cfg_attr(gnu_file_offset_bits64, link_name = "lseek64")] + pub fn lseek(fd: c_int, offset: off_t, whence: c_int) -> off_t; + + #[cfg(not(any(target_os = "fuchsia", target_os = "vxworks")))] + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "nice$UNIX2003" + )] + pub fn nice(incr: c_int) -> c_int; + + pub fn pathconf(path: *const c_char, name: c_int) -> c_long; + + #[cfg(not(target_os = "redox"))] + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "pause$UNIX2003" + )] + pub fn pause() -> c_int; + + pub fn pipe(fds: *mut c_int) -> c_int; + + #[cfg(not(target_os = "vxworks"))] + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "pread$UNIX2003" + )] + #[cfg_attr(gnu_file_offset_bits64, link_name = "pread64")] + pub fn pread(fd: c_int, buf: *mut c_void, count: size_t, offset: off_t) -> ssize_t; + + #[cfg(not(target_os = "vxworks"))] + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "pwrite$UNIX2003" + )] + #[cfg_attr(gnu_file_offset_bits64, link_name = "pwrite64")] + pub fn pwrite(fd: c_int, buf: *const c_void, count: size_t, offset: off_t) -> ssize_t; + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "read$UNIX2003" + )] + pub fn read(fd: c_int, buf: *mut c_void, count: size_t) -> ssize_t; + + #[cfg(not(target_os = "nto"))] + pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: size_t) -> ssize_t; + + pub fn rmdir(path: *const c_char) -> c_int; + + pub fn setegid(gid: gid_t) -> c_int; + pub fn seteuid(uid: uid_t) -> c_int; + pub fn setgid(gid: gid_t) -> c_int; + + #[cfg(not(target_os = "vxworks"))] + pub fn setpgid(pid: pid_t, pgid: pid_t) -> c_int; + + // Support for setpgrp varies + + #[cfg(not(target_os = "vxworks"))] + pub fn setregid(rgid: gid_t, egid: gid_t) -> c_int; + + #[cfg(not(target_os = "vxworks"))] + pub fn setreuid(ruid: uid_t, euid: uid_t) -> c_int; + + #[cfg(not(target_os = "vxworks"))] + pub fn setsid() -> pid_t; + pub fn setuid(uid: uid_t) -> c_int; + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "sleep$UNIX2003" + )] + pub fn sleep(secs: c_uint) -> c_uint; + // Not provided: swab + + pub fn symlink(path1: *const c_char, path2: *const c_char) -> c_int; + // Support for sync varies + + #[cfg_attr(target_os = "solaris", link_name = "__sysconf_xpg7")] + pub fn sysconf(name: c_int) -> c_long; + + #[cfg(not(target_os = "vxworks"))] + pub fn tcgetpgrp(fd: c_int) -> pid_t; + + #[cfg(not(target_os = "vxworks"))] + pub fn tcsetpgrp(fd: c_int, pgrp: pid_t) -> c_int; + + #[cfg(not(target_os = "fuchsia"))] + #[cfg_attr(gnu_file_offset_bits64, link_name = "truncate64")] + pub fn truncate(path: *const c_char, length: off_t) -> c_int; + + pub fn ttyname(fd: c_int) -> *mut c_char; + + #[cfg(not(any(target_os = "fuchsia", target_os = "vxworks")))] + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "ttyname_r$UNIX2003" + )] + #[cfg_attr( + any(target_os = "illumos", target_os = "solaris"), + link_name = "__posix_ttyname_r" + )] + pub fn ttyname_r(fd: c_int, buf: *mut c_char, buflen: size_t) -> c_int; + + // Not provided: ualarm + + pub fn unlink(c: *const c_char) -> c_int; + + // FIXME(unix): usleep could probably live here but our definition seems incorrect (c_uint vs. + // useconds_t). + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "write$UNIX2003" + )] + pub fn write(fd: c_int, buf: *const c_void, count: size_t) -> ssize_t; +} + +// Statics optarg, optind, opterr, and optopt are not provided. diff --git a/src/new/cygwin/unistd.rs b/src/new/cygwin/unistd.rs index 8d55ee582331..2d252b5c39a9 100644 --- a/src/new/cygwin/unistd.rs +++ b/src/new/cygwin/unistd.rs @@ -1,6 +1,73 @@ //! Header: `unistd.h` pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + confstr, + dup, + dup2, + execl, + execle, + execlp, + execv, + execve, + execvp, + fchdir, + fchown, + fork, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + gethostname, + getlogin, + getopt, + getpgid, + getpgrp, + getpid, + getppid, + getsid, + getuid, + isatty, + lchown, + link, + lockf, + lseek, + nice, + pathconf, + pause, + pipe, + pread, + pwrite, + read, + readlink, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setregid, + setreuid, + setsid, + setuid, + sleep, + symlink, + sysconf, + tcgetpgrp, + tcsetpgrp, + truncate, + ttyname, + ttyname_r, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/new/dragonfly/unistd.rs b/src/new/dragonfly/unistd.rs index 8d55ee582331..2d252b5c39a9 100644 --- a/src/new/dragonfly/unistd.rs +++ b/src/new/dragonfly/unistd.rs @@ -1,6 +1,73 @@ //! Header: `unistd.h` pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + confstr, + dup, + dup2, + execl, + execle, + execlp, + execv, + execve, + execvp, + fchdir, + fchown, + fork, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + gethostname, + getlogin, + getopt, + getpgid, + getpgrp, + getpid, + getppid, + getsid, + getuid, + isatty, + lchown, + link, + lockf, + lseek, + nice, + pathconf, + pause, + pipe, + pread, + pwrite, + read, + readlink, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setregid, + setreuid, + setsid, + setuid, + sleep, + symlink, + sysconf, + tcgetpgrp, + tcsetpgrp, + truncate, + ttyname, + ttyname_r, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/new/emscripten/unistd.rs b/src/new/emscripten/unistd.rs index 8d55ee582331..2d252b5c39a9 100644 --- a/src/new/emscripten/unistd.rs +++ b/src/new/emscripten/unistd.rs @@ -1,6 +1,73 @@ //! Header: `unistd.h` pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + confstr, + dup, + dup2, + execl, + execle, + execlp, + execv, + execve, + execvp, + fchdir, + fchown, + fork, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + gethostname, + getlogin, + getopt, + getpgid, + getpgrp, + getpid, + getppid, + getsid, + getuid, + isatty, + lchown, + link, + lockf, + lseek, + nice, + pathconf, + pause, + pipe, + pread, + pwrite, + read, + readlink, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setregid, + setreuid, + setsid, + setuid, + sleep, + symlink, + sysconf, + tcgetpgrp, + tcsetpgrp, + truncate, + ttyname, + ttyname_r, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/new/freebsd/unistd.rs b/src/new/freebsd/unistd.rs index 8d55ee582331..2d252b5c39a9 100644 --- a/src/new/freebsd/unistd.rs +++ b/src/new/freebsd/unistd.rs @@ -1,6 +1,73 @@ //! Header: `unistd.h` pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + confstr, + dup, + dup2, + execl, + execle, + execlp, + execv, + execve, + execvp, + fchdir, + fchown, + fork, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + gethostname, + getlogin, + getopt, + getpgid, + getpgrp, + getpid, + getppid, + getsid, + getuid, + isatty, + lchown, + link, + lockf, + lseek, + nice, + pathconf, + pause, + pipe, + pread, + pwrite, + read, + readlink, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setregid, + setreuid, + setsid, + setuid, + sleep, + symlink, + sysconf, + tcgetpgrp, + tcsetpgrp, + truncate, + ttyname, + ttyname_r, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/new/fuchsia/unistd.rs b/src/new/fuchsia/unistd.rs index 8d55ee582331..3c11d22b898a 100644 --- a/src/new/fuchsia/unistd.rs +++ b/src/new/fuchsia/unistd.rs @@ -1,6 +1,68 @@ //! Header: `unistd.h` pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + confstr, + dup, + dup2, + execl, + execle, + execlp, + execv, + execve, + execvp, + fchown, + fork, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + gethostname, + getlogin, + getopt, + getpgid, + getpgrp, + getpid, + getppid, + getsid, + getuid, + isatty, + lchown, + link, + lseek, + pathconf, + pause, + pipe, + pread, + pwrite, + read, + readlink, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setregid, + setreuid, + setsid, + setuid, + sleep, + symlink, + sysconf, + tcgetpgrp, + tcsetpgrp, + ttyname, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/new/glibc/unistd.rs b/src/new/glibc/unistd.rs index 8d55ee582331..2d252b5c39a9 100644 --- a/src/new/glibc/unistd.rs +++ b/src/new/glibc/unistd.rs @@ -1,6 +1,73 @@ //! Header: `unistd.h` pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + confstr, + dup, + dup2, + execl, + execle, + execlp, + execv, + execve, + execvp, + fchdir, + fchown, + fork, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + gethostname, + getlogin, + getopt, + getpgid, + getpgrp, + getpid, + getppid, + getsid, + getuid, + isatty, + lchown, + link, + lockf, + lseek, + nice, + pathconf, + pause, + pipe, + pread, + pwrite, + read, + readlink, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setregid, + setreuid, + setsid, + setuid, + sleep, + symlink, + sysconf, + tcgetpgrp, + tcsetpgrp, + truncate, + ttyname, + ttyname_r, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/new/haiku/unistd.rs b/src/new/haiku/unistd.rs index 8d55ee582331..2d252b5c39a9 100644 --- a/src/new/haiku/unistd.rs +++ b/src/new/haiku/unistd.rs @@ -1,6 +1,73 @@ //! Header: `unistd.h` pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + confstr, + dup, + dup2, + execl, + execle, + execlp, + execv, + execve, + execvp, + fchdir, + fchown, + fork, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + gethostname, + getlogin, + getopt, + getpgid, + getpgrp, + getpid, + getppid, + getsid, + getuid, + isatty, + lchown, + link, + lockf, + lseek, + nice, + pathconf, + pause, + pipe, + pread, + pwrite, + read, + readlink, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setregid, + setreuid, + setsid, + setuid, + sleep, + symlink, + sysconf, + tcgetpgrp, + tcsetpgrp, + truncate, + ttyname, + ttyname_r, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/new/hermit_abi/hermit_mod.rs b/src/new/hermit_abi/hermit_mod.rs new file mode 100644 index 000000000000..65f59fe12d69 --- /dev/null +++ b/src/new/hermit_abi/hermit_mod.rs @@ -0,0 +1,3 @@ +//! Hermit kernel libc. +//! +//! * Headers: diff --git a/src/new/hurd/mod.rs b/src/new/hurd/mod.rs index 12198d58bd58..875bfc4432ac 100644 --- a/src/new/hurd/mod.rs +++ b/src/new/hurd/mod.rs @@ -1,2 +1,4 @@ //! GNU Hurd libc. +//! +//! Hurd interfaces come from the glibc module. // FIXME(hurd): link to headers needed. diff --git a/src/new/illumos/unistd.rs b/src/new/illumos/unistd.rs index 8d55ee582331..2d252b5c39a9 100644 --- a/src/new/illumos/unistd.rs +++ b/src/new/illumos/unistd.rs @@ -1,6 +1,73 @@ //! Header: `unistd.h` pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + confstr, + dup, + dup2, + execl, + execle, + execlp, + execv, + execve, + execvp, + fchdir, + fchown, + fork, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + gethostname, + getlogin, + getopt, + getpgid, + getpgrp, + getpid, + getppid, + getsid, + getuid, + isatty, + lchown, + link, + lockf, + lseek, + nice, + pathconf, + pause, + pipe, + pread, + pwrite, + read, + readlink, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setregid, + setreuid, + setsid, + setuid, + sleep, + symlink, + sysconf, + tcgetpgrp, + tcsetpgrp, + truncate, + ttyname, + ttyname_r, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/new/musl/unistd.rs b/src/new/musl/unistd.rs index 8d55ee582331..2d252b5c39a9 100644 --- a/src/new/musl/unistd.rs +++ b/src/new/musl/unistd.rs @@ -1,6 +1,73 @@ //! Header: `unistd.h` pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + confstr, + dup, + dup2, + execl, + execle, + execlp, + execv, + execve, + execvp, + fchdir, + fchown, + fork, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + gethostname, + getlogin, + getopt, + getpgid, + getpgrp, + getpid, + getppid, + getsid, + getuid, + isatty, + lchown, + link, + lockf, + lseek, + nice, + pathconf, + pause, + pipe, + pread, + pwrite, + read, + readlink, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setregid, + setreuid, + setsid, + setuid, + sleep, + symlink, + sysconf, + tcgetpgrp, + tcsetpgrp, + truncate, + ttyname, + ttyname_r, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/new/netbsd/unistd.rs b/src/new/netbsd/unistd.rs index 8d55ee582331..2d252b5c39a9 100644 --- a/src/new/netbsd/unistd.rs +++ b/src/new/netbsd/unistd.rs @@ -1,6 +1,73 @@ //! Header: `unistd.h` pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + confstr, + dup, + dup2, + execl, + execle, + execlp, + execv, + execve, + execvp, + fchdir, + fchown, + fork, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + gethostname, + getlogin, + getopt, + getpgid, + getpgrp, + getpid, + getppid, + getsid, + getuid, + isatty, + lchown, + link, + lockf, + lseek, + nice, + pathconf, + pause, + pipe, + pread, + pwrite, + read, + readlink, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setregid, + setreuid, + setsid, + setuid, + sleep, + symlink, + sysconf, + tcgetpgrp, + tcsetpgrp, + truncate, + ttyname, + ttyname_r, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/new/newlib/unistd.rs b/src/new/newlib/unistd.rs index 8d55ee582331..70222d1596bd 100644 --- a/src/new/newlib/unistd.rs +++ b/src/new/newlib/unistd.rs @@ -1,6 +1,74 @@ //! Header: `unistd.h` +#[cfg(not(target_os = "espidf"))] +pub use crate::new::common::posix::unistd::gethostname; pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + confstr, + dup, + dup2, + execl, + execle, + execlp, + execv, + execve, + execvp, + fchdir, + fchown, + fork, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + getlogin, + getopt, + getpgid, + getpgrp, + getpid, + getppid, + getsid, + getuid, + isatty, + lchown, + link, + lockf, + lseek, + nice, + pathconf, + pause, + pipe, + pread, + pwrite, + read, + readlink, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setregid, + setreuid, + setsid, + setuid, + sleep, + symlink, + sysconf, + tcgetpgrp, + tcsetpgrp, + truncate, + ttyname, + ttyname_r, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/new/nto/unistd.rs b/src/new/nto/unistd.rs index 8d55ee582331..eb48e0175b04 100644 --- a/src/new/nto/unistd.rs +++ b/src/new/nto/unistd.rs @@ -1,6 +1,72 @@ //! Header: `unistd.h` pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + confstr, + dup, + dup2, + execl, + execle, + execlp, + execv, + execve, + execvp, + fchdir, + fchown, + fork, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + gethostname, + getlogin, + getopt, + getpgid, + getpgrp, + getpid, + getppid, + getsid, + getuid, + isatty, + lchown, + link, + lockf, + lseek, + nice, + pathconf, + pause, + pipe, + pread, + pwrite, + read, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setregid, + setreuid, + setsid, + setuid, + sleep, + symlink, + sysconf, + tcgetpgrp, + tcsetpgrp, + truncate, + ttyname, + ttyname_r, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/new/nuttx/unistd.rs b/src/new/nuttx/unistd.rs index 8d55ee582331..2d252b5c39a9 100644 --- a/src/new/nuttx/unistd.rs +++ b/src/new/nuttx/unistd.rs @@ -1,6 +1,73 @@ //! Header: `unistd.h` pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + confstr, + dup, + dup2, + execl, + execle, + execlp, + execv, + execve, + execvp, + fchdir, + fchown, + fork, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + gethostname, + getlogin, + getopt, + getpgid, + getpgrp, + getpid, + getppid, + getsid, + getuid, + isatty, + lchown, + link, + lockf, + lseek, + nice, + pathconf, + pause, + pipe, + pread, + pwrite, + read, + readlink, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setregid, + setreuid, + setsid, + setuid, + sleep, + symlink, + sysconf, + tcgetpgrp, + tcsetpgrp, + truncate, + ttyname, + ttyname_r, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/new/openbsd/unistd.rs b/src/new/openbsd/unistd.rs index 8d55ee582331..2d252b5c39a9 100644 --- a/src/new/openbsd/unistd.rs +++ b/src/new/openbsd/unistd.rs @@ -1,6 +1,73 @@ //! Header: `unistd.h` pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + confstr, + dup, + dup2, + execl, + execle, + execlp, + execv, + execve, + execvp, + fchdir, + fchown, + fork, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + gethostname, + getlogin, + getopt, + getpgid, + getpgrp, + getpid, + getppid, + getsid, + getuid, + isatty, + lchown, + link, + lockf, + lseek, + nice, + pathconf, + pause, + pipe, + pread, + pwrite, + read, + readlink, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setregid, + setreuid, + setsid, + setuid, + sleep, + symlink, + sysconf, + tcgetpgrp, + tcsetpgrp, + truncate, + ttyname, + ttyname_r, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/new/relibc/unistd.rs b/src/new/relibc/unistd.rs index 8d55ee582331..e558dd7712b6 100644 --- a/src/new/relibc/unistd.rs +++ b/src/new/relibc/unistd.rs @@ -1,6 +1,71 @@ //! Header: `unistd.h` pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + confstr, + dup, + dup2, + execl, + execle, + execlp, + execv, + execve, + execvp, + fchdir, + fchown, + fork, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + gethostname, + getlogin, + getopt, + getpgid, + getpgrp, + getpid, + getppid, + getuid, + isatty, + lchown, + link, + lockf, + lseek, + nice, + pathconf, + pipe, + pread, + pwrite, + read, + readlink, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setregid, + setreuid, + setsid, + setuid, + sleep, + symlink, + sysconf, + tcgetpgrp, + tcsetpgrp, + truncate, + ttyname, + ttyname_r, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/new/sgx/unistd.rs b/src/new/sgx/unistd.rs index 8d55ee582331..2d252b5c39a9 100644 --- a/src/new/sgx/unistd.rs +++ b/src/new/sgx/unistd.rs @@ -1,6 +1,73 @@ //! Header: `unistd.h` pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + confstr, + dup, + dup2, + execl, + execle, + execlp, + execv, + execve, + execvp, + fchdir, + fchown, + fork, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + gethostname, + getlogin, + getopt, + getpgid, + getpgrp, + getpid, + getppid, + getsid, + getuid, + isatty, + lchown, + link, + lockf, + lseek, + nice, + pathconf, + pause, + pipe, + pread, + pwrite, + read, + readlink, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setregid, + setreuid, + setsid, + setuid, + sleep, + symlink, + sysconf, + tcgetpgrp, + tcsetpgrp, + truncate, + ttyname, + ttyname_r, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/new/solaris/unistd.rs b/src/new/solaris/unistd.rs index 8d55ee582331..2d252b5c39a9 100644 --- a/src/new/solaris/unistd.rs +++ b/src/new/solaris/unistd.rs @@ -1,6 +1,73 @@ //! Header: `unistd.h` pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + confstr, + dup, + dup2, + execl, + execle, + execlp, + execv, + execve, + execvp, + fchdir, + fchown, + fork, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + gethostname, + getlogin, + getopt, + getpgid, + getpgrp, + getpid, + getppid, + getsid, + getuid, + isatty, + lchown, + link, + lockf, + lseek, + nice, + pathconf, + pause, + pipe, + pread, + pwrite, + read, + readlink, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setregid, + setreuid, + setsid, + setuid, + sleep, + symlink, + sysconf, + tcgetpgrp, + tcsetpgrp, + truncate, + ttyname, + ttyname_r, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/new/uclibc/unistd.rs b/src/new/uclibc/unistd.rs index 8d55ee582331..2d252b5c39a9 100644 --- a/src/new/uclibc/unistd.rs +++ b/src/new/uclibc/unistd.rs @@ -1,6 +1,73 @@ //! Header: `unistd.h` pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + confstr, + dup, + dup2, + execl, + execle, + execlp, + execv, + execve, + execvp, + fchdir, + fchown, + fork, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + gethostname, + getlogin, + getopt, + getpgid, + getpgrp, + getpid, + getppid, + getsid, + getuid, + isatty, + lchown, + link, + lockf, + lseek, + nice, + pathconf, + pause, + pipe, + pread, + pwrite, + read, + readlink, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setregid, + setreuid, + setsid, + setuid, + sleep, + symlink, + sysconf, + tcgetpgrp, + tcsetpgrp, + truncate, + ttyname, + ttyname_r, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/new/vita/unistd.rs b/src/new/vita/unistd.rs index 8d55ee582331..2d252b5c39a9 100644 --- a/src/new/vita/unistd.rs +++ b/src/new/vita/unistd.rs @@ -1,6 +1,73 @@ //! Header: `unistd.h` pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + confstr, + dup, + dup2, + execl, + execle, + execlp, + execv, + execve, + execvp, + fchdir, + fchown, + fork, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + gethostname, + getlogin, + getopt, + getpgid, + getpgrp, + getpid, + getppid, + getsid, + getuid, + isatty, + lchown, + link, + lockf, + lseek, + nice, + pathconf, + pause, + pipe, + pread, + pwrite, + read, + readlink, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setregid, + setreuid, + setsid, + setuid, + sleep, + symlink, + sysconf, + tcgetpgrp, + tcsetpgrp, + truncate, + ttyname, + ttyname_r, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/new/vxworks/unistd.rs b/src/new/vxworks/unistd.rs index 8d55ee582331..cdff7cf5867d 100644 --- a/src/new/vxworks/unistd.rs +++ b/src/new/vxworks/unistd.rs @@ -1,6 +1,51 @@ //! Header: `unistd.h` pub use crate::new::common::posix::unistd::{ + _exit, + access, + alarm, + chdir, + chown, + close, + dup, + dup2, + fchdir, + fchown, + fpathconf, + fsync, + ftruncate, + getcwd, + getegid, + geteuid, + getgid, + getgroups, + gethostname, + getlogin, + getopt, + getpid, + getppid, + getuid, + isatty, + link, + lseek, + pathconf, + pause, + pipe, + read, + readlink, + rmdir, + setegid, + seteuid, + setgid, + setpgid, + setuid, + sleep, + symlink, + sysconf, + truncate, + ttyname, + unlink, + write, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, diff --git a/src/unix/cygwin/mod.rs b/src/unix/cygwin/mod.rs index 0e5faff17fb8..15a58c0f8ff1 100644 --- a/src/unix/cygwin/mod.rs +++ b/src/unix/cygwin/mod.rs @@ -117,7 +117,6 @@ s! { pub tm_gmtoff: c_long, pub tm_zone: *const c_char, } - pub struct bintime { pub sec: time_t, pub frac: u64, diff --git a/src/unix/hurd/mod.rs b/src/unix/hurd/mod.rs index d88f6f933e18..060add3634f2 100644 --- a/src/unix/hurd/mod.rs +++ b/src/unix/hurd/mod.rs @@ -3665,8 +3665,6 @@ extern "C" { pub fn lseek64(__fd: c_int, __offset: __off64_t, __whence: c_int) -> __off64_t; - pub fn lseek(__fd: c_int, __offset: __off_t, __whence: c_int) -> __off_t; - pub fn fgetpos64(stream: *mut crate::FILE, ptr: *mut fpos64_t) -> c_int; pub fn fseeko64(stream: *mut crate::FILE, offset: off64_t, whence: c_int) -> c_int; pub fn fsetpos64(stream: *mut crate::FILE, ptr: *const fpos64_t) -> c_int; @@ -4061,7 +4059,6 @@ extern "C" { statxbuf: *mut statx, ) -> c_int; - pub fn ftruncate(__fd: c_int, __length: __off_t) -> c_int; pub fn ftruncate64(__fd: c_int, __length: __off64_t) -> c_int; pub fn truncate64(__file: *const c_char, __length: __off64_t) -> c_int; diff --git a/src/unix/mod.rs b/src/unix/mod.rs index dbf84dc8d977..9c75970f9f9a 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -699,7 +699,6 @@ extern "C" { pub fn free(p: *mut c_void); pub fn abort() -> !; pub fn exit(status: c_int) -> !; - pub fn _exit(status: c_int) -> !; #[cfg_attr( all(target_os = "macos", target_arch = "x86"), link_name = "system$UNIX2003" @@ -983,7 +982,6 @@ extern "C" { pub fn rewinddir(dirp: *mut crate::DIR); pub fn fchmodat(dirfd: c_int, pathname: *const c_char, mode: mode_t, flags: c_int) -> c_int; - pub fn fchown(fd: c_int, owner: crate::uid_t, group: crate::gid_t) -> c_int; pub fn fchownat( dirfd: c_int, pathname: *const c_char, @@ -1021,83 +1019,8 @@ extern "C" { pub fn symlinkat(target: *const c_char, newdirfd: c_int, linkpath: *const c_char) -> c_int; pub fn unlinkat(dirfd: c_int, pathname: *const c_char, flags: c_int) -> c_int; - pub fn access(path: *const c_char, amode: c_int) -> c_int; - pub fn alarm(seconds: c_uint) -> c_uint; - pub fn chdir(dir: *const c_char) -> c_int; - pub fn fchdir(dirfd: c_int) -> c_int; - pub fn chown(path: *const c_char, uid: uid_t, gid: gid_t) -> c_int; - #[cfg_attr( - all(target_os = "macos", target_arch = "x86"), - link_name = "lchown$UNIX2003" - )] - pub fn lchown(path: *const c_char, uid: uid_t, gid: gid_t) -> c_int; - #[cfg_attr( - all(target_os = "macos", target_arch = "x86"), - link_name = "close$NOCANCEL$UNIX2003" - )] - #[cfg_attr( - all(target_os = "macos", target_arch = "x86_64"), - link_name = "close$NOCANCEL" - )] - pub fn close(fd: c_int) -> c_int; - pub fn dup(fd: c_int) -> c_int; - pub fn dup2(src: c_int, dst: c_int) -> c_int; - - pub fn execl(path: *const c_char, arg0: *const c_char, ...) -> c_int; - pub fn execle(path: *const c_char, arg0: *const c_char, ...) -> c_int; - pub fn execlp(file: *const c_char, arg0: *const c_char, ...) -> c_int; - pub fn execv(prog: *const c_char, argv: *const *mut c_char) -> c_int; - pub fn execve(prog: *const c_char, argv: *const *mut c_char, envp: *const *mut c_char) - -> c_int; - pub fn execvp(c: *const c_char, argv: *const *mut c_char) -> c_int; - - pub fn fork() -> pid_t; - pub fn fpathconf(filedes: c_int, name: c_int) -> c_long; - pub fn getcwd(buf: *mut c_char, size: size_t) -> *mut c_char; - pub fn getegid() -> gid_t; - pub fn geteuid() -> uid_t; - pub fn getgid() -> gid_t; - pub fn getgroups(ngroups_max: c_int, groups: *mut gid_t) -> c_int; - #[cfg_attr(target_os = "illumos", link_name = "getloginx")] - pub fn getlogin() -> *mut c_char; - #[cfg_attr( - all(target_os = "macos", target_arch = "x86"), - link_name = "getopt$UNIX2003" - )] - pub fn getopt(argc: c_int, argv: *const *mut c_char, optstr: *const c_char) -> c_int; - pub fn getpgid(pid: pid_t) -> pid_t; - pub fn getpgrp() -> pid_t; - pub fn getpid() -> pid_t; - pub fn getppid() -> pid_t; - pub fn getuid() -> uid_t; - pub fn isatty(fd: c_int) -> c_int; - #[cfg_attr(target_os = "solaris", link_name = "__link_xpg4")] - pub fn link(src: *const c_char, dst: *const c_char) -> c_int; - #[cfg_attr(gnu_file_offset_bits64, link_name = "lseek64")] - pub fn lseek(fd: c_int, offset: off_t, whence: c_int) -> off_t; - pub fn pathconf(path: *const c_char, name: c_int) -> c_long; - pub fn pipe(fds: *mut c_int) -> c_int; pub fn posix_memalign(memptr: *mut *mut c_void, align: size_t, size: size_t) -> c_int; pub fn aligned_alloc(alignment: size_t, size: size_t) -> *mut c_void; - #[cfg_attr( - all(target_os = "macos", target_arch = "x86"), - link_name = "read$UNIX2003" - )] - pub fn read(fd: c_int, buf: *mut c_void, count: size_t) -> ssize_t; - pub fn rmdir(path: *const c_char) -> c_int; - pub fn seteuid(uid: uid_t) -> c_int; - pub fn setegid(gid: gid_t) -> c_int; - pub fn setgid(gid: gid_t) -> c_int; - pub fn setpgid(pid: pid_t, pgid: pid_t) -> c_int; - pub fn setsid() -> pid_t; - pub fn setuid(uid: uid_t) -> c_int; - pub fn setreuid(ruid: uid_t, euid: uid_t) -> c_int; - pub fn setregid(rgid: gid_t, egid: gid_t) -> c_int; - #[cfg_attr( - all(target_os = "macos", target_arch = "x86"), - link_name = "sleep$UNIX2003" - )] - pub fn sleep(secs: c_uint) -> c_uint; #[cfg_attr( all(target_os = "macos", target_arch = "x86"), link_name = "nanosleep$UNIX2003" @@ -1105,19 +1028,6 @@ extern "C" { #[cfg_attr(target_os = "netbsd", link_name = "__nanosleep50")] #[cfg_attr(gnu_time_bits64, link_name = "__nanosleep64")] pub fn nanosleep(rqtp: *const timespec, rmtp: *mut timespec) -> c_int; - pub fn tcgetpgrp(fd: c_int) -> pid_t; - pub fn tcsetpgrp(fd: c_int, pgrp: crate::pid_t) -> c_int; - pub fn ttyname(fd: c_int) -> *mut c_char; - #[cfg_attr( - all(target_os = "macos", target_arch = "x86"), - link_name = "ttyname_r$UNIX2003" - )] - #[cfg_attr( - any(target_os = "illumos", target_os = "solaris"), - link_name = "__posix_ttyname_r" - )] - pub fn ttyname_r(fd: c_int, buf: *mut c_char, buflen: size_t) -> c_int; - pub fn unlink(c: *const c_char) -> c_int; #[cfg_attr( all(target_os = "macos", target_arch = "x86"), link_name = "wait$UNIX2003" @@ -1128,23 +1038,6 @@ extern "C" { link_name = "waitpid$UNIX2003" )] pub fn waitpid(pid: pid_t, status: *mut c_int, options: c_int) -> pid_t; - #[cfg_attr( - all(target_os = "macos", target_arch = "x86"), - link_name = "write$UNIX2003" - )] - pub fn write(fd: c_int, buf: *const c_void, count: size_t) -> ssize_t; - #[cfg_attr( - all(target_os = "macos", target_arch = "x86"), - link_name = "pread$UNIX2003" - )] - #[cfg_attr(gnu_file_offset_bits64, link_name = "pread64")] - pub fn pread(fd: c_int, buf: *mut c_void, count: size_t, offset: off_t) -> ssize_t; - #[cfg_attr( - all(target_os = "macos", target_arch = "x86"), - link_name = "pwrite$UNIX2003" - )] - #[cfg_attr(gnu_file_offset_bits64, link_name = "pwrite64")] - pub fn pwrite(fd: c_int, buf: *const c_void, count: size_t, offset: off_t) -> ssize_t; pub fn umask(mask: mode_t) -> mode_t; #[cfg_attr(target_os = "netbsd", link_name = "__utime50")] @@ -1205,12 +1098,6 @@ extern "C" { )] pub fn lstat(path: *const c_char, buf: *mut stat) -> c_int; - #[cfg_attr( - all(target_os = "macos", target_arch = "x86"), - link_name = "fsync$UNIX2003" - )] - pub fn fsync(fd: c_int) -> c_int; - #[cfg_attr( all(target_os = "macos", target_arch = "x86"), link_name = "setenv$UNIX2003" @@ -1222,14 +1109,6 @@ extern "C" { )] #[cfg_attr(target_os = "netbsd", link_name = "__unsetenv13")] pub fn unsetenv(name: *const c_char) -> c_int; - - pub fn symlink(path1: *const c_char, path2: *const c_char) -> c_int; - - #[cfg_attr(gnu_file_offset_bits64, link_name = "truncate64")] - pub fn truncate(path: *const c_char, length: off_t) -> c_int; - #[cfg_attr(gnu_file_offset_bits64, link_name = "ftruncate64")] - pub fn ftruncate(fd: c_int, length: off_t) -> c_int; - pub fn signal(signum: c_int, handler: sighandler_t) -> sighandler_t; #[cfg_attr(target_os = "netbsd", link_name = "__getrusage50")] @@ -1479,8 +1358,6 @@ extern "C" { link_name = "mknod@FBSD_1.0" )] pub fn mknod(pathname: *const c_char, mode: mode_t, dev: crate::dev_t) -> c_int; - #[cfg(not(target_os = "espidf"))] - pub fn gethostname(name: *mut c_char, len: size_t) -> c_int; pub fn endservent(); pub fn getservbyname(name: *const c_char, proto: *const c_char) -> *mut servent; pub fn getservbyport(port: c_int, proto: *const c_char) -> *mut servent; @@ -1570,9 +1447,6 @@ extern "C" { #[cfg_attr(target_os = "netbsd", link_name = "__sigpending14")] pub fn sigpending(set: *mut sigset_t) -> c_int; - #[cfg_attr(target_os = "solaris", link_name = "__sysconf_xpg7")] - pub fn sysconf(name: c_int) -> c_long; - pub fn mkfifo(path: *const c_char, mode: mode_t) -> c_int; #[cfg_attr(gnu_file_offset_bits64, link_name = "fseeko64")] @@ -1605,11 +1479,6 @@ extern "C" { pub fn setlogmask(maskpri: c_int) -> c_int; #[cfg_attr(target_os = "macos", link_name = "syslog$DARWIN_EXTSN")] pub fn syslog(priority: c_int, message: *const c_char, ...); - #[cfg_attr( - all(target_os = "macos", target_arch = "x86"), - link_name = "nice$UNIX2003" - )] - pub fn nice(incr: c_int) -> c_int; pub fn grantpt(fd: c_int) -> c_int; pub fn posix_openpt(flags: c_int) -> c_int; @@ -1620,9 +1489,6 @@ extern "C" { pub fn strcasestr(cs: *const c_char, ct: *const c_char) -> *mut c_char; pub fn getline(lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t; - #[cfg_attr(gnu_file_offset_bits64, link_name = "lockf64")] - pub fn lockf(fd: c_int, cmd: c_int, len: off_t) -> c_int; - } safe_f! { @@ -1689,19 +1555,6 @@ cfg_if! { } } -cfg_if! { - if #[cfg(not(target_os = "android"))] { - extern "C" { - #[cfg_attr( - all(target_os = "macos", target_arch = "x86"), - link_name = "confstr$UNIX2003" - )] - #[cfg_attr(target_os = "solaris", link_name = "__confstr_xpg7")] - pub fn confstr(name: c_int, buf: *mut c_char, len: size_t) -> size_t; - } - } -} - cfg_if! { if #[cfg(not(target_os = "aix"))] { extern "C" { @@ -1729,13 +1582,6 @@ cfg_if! { cfg_if! { if #[cfg(not(target_os = "redox"))] { extern "C" { - pub fn getsid(pid: pid_t) -> pid_t; - #[cfg_attr( - all(target_os = "macos", target_arch = "x86"), - link_name = "pause$UNIX2003" - )] - pub fn pause() -> c_int; - pub fn mkdirat(dirfd: c_int, pathname: *const c_char, mode: mode_t) -> c_int; #[cfg_attr(gnu_file_offset_bits64, link_name = "openat64")] pub fn openat(dirfd: c_int, pathname: *const c_char, flags: c_int, ...) -> c_int; @@ -1815,7 +1661,6 @@ cfg_if! { #[cfg_attr(target_os = "netbsd", link_name = "__sigaction14")] pub fn sigaction(signum: c_int, act: *const sigaction, oldact: *mut sigaction) -> c_int; - pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: size_t) -> ssize_t; #[cfg_attr( all(target_os = "macos", target_arch = "x86_64"), link_name = "pselect$1050" diff --git a/src/vxworks/mod.rs b/src/vxworks/mod.rs index ad1b0f9d0981..eaf049a2d90f 100644 --- a/src/vxworks/mod.rs +++ b/src/vxworks/mod.rs @@ -1600,23 +1600,6 @@ extern "C" { pub fn fileno(stream: *mut crate::FILE) -> c_int; pub fn creat(path: *const c_char, mode: mode_t) -> c_int; pub fn rewinddir(dirp: *mut crate::DIR); - pub fn fchown(fd: c_int, owner: crate::uid_t, group: crate::gid_t) -> c_int; - pub fn access(path: *const c_char, amode: c_int) -> c_int; - pub fn alarm(seconds: c_uint) -> c_uint; - pub fn fchdir(dirfd: c_int) -> c_int; - pub fn chown(path: *const c_char, uid: uid_t, gid: gid_t) -> c_int; - pub fn fpathconf(filedes: c_int, name: c_int) -> c_long; - pub fn getegid() -> gid_t; - pub fn geteuid() -> uid_t; - pub fn getgroups(ngroups_max: c_int, groups: *mut gid_t) -> c_int; - pub fn getlogin() -> *mut c_char; - pub fn getopt(argc: c_int, argv: *const *mut c_char, optstr: *const c_char) -> c_int; - pub fn pathconf(path: *const c_char, name: c_int) -> c_long; - pub fn pause() -> c_int; - pub fn seteuid(uid: uid_t) -> c_int; - pub fn setegid(gid: gid_t) -> c_int; - pub fn sleep(secs: c_uint) -> c_uint; - pub fn ttyname(fd: c_int) -> *mut c_char; pub fn wait(status: *mut c_int) -> pid_t; pub fn umask(mask: mode_t) -> mode_t; pub fn mlock(addr: *const c_void, len: size_t) -> c_int; @@ -1637,7 +1620,6 @@ extern "C" { pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int; pub fn msync(addr: *mut c_void, len: size_t, flags: c_int) -> c_int; - pub fn truncate(path: *const c_char, length: off_t) -> c_int; pub fn shm_open(name: *const c_char, oflag: c_int, mode: mode_t) -> c_int; pub fn shm_unlink(name: *const c_char) -> c_int; @@ -1687,7 +1669,6 @@ extern "C" { pub fn localtime(time_p: *const time_t) -> *mut tm; pub fn timegm(tm: *mut tm) -> time_t; pub fn difftime(time1: time_t, time0: time_t) -> c_double; - pub fn gethostname(name: *mut c_char, len: size_t) -> c_int; pub fn usleep(secs: crate::useconds_t) -> c_int; pub fn putenv(string: *mut c_char) -> c_int; pub fn setlocale(category: c_int, locale: *const c_char) -> *mut c_char; @@ -1728,12 +1709,6 @@ extern "C" { // stdlib.h pub fn memalign(block_size: size_t, size_arg: size_t) -> *mut c_void; - // ioLib.h - pub fn getcwd(buf: *mut c_char, size: size_t) -> *mut c_char; - - // ioLib.h - pub fn chdir(attr: *const c_char) -> c_int; - // pthread.h pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> c_int; @@ -1830,9 +1805,6 @@ extern "C" { // stat.h pub fn lstat(path: *const c_char, buf: *mut stat) -> c_int; - // unistd.h - pub fn ftruncate(fd: c_int, length: off_t) -> c_int; - // dirent.h pub fn readdir_r( pDir: *mut crate::DIR, @@ -2075,42 +2047,6 @@ extern "C" { // netdb.h for user pub fn gai_strerror(errcode: c_int) -> *mut c_char; - // ioLib.h or - // unistd.h - pub fn close(fd: c_int) -> c_int; - - // ioLib.h or - // unistd.h - pub fn read(fd: c_int, buf: *mut c_void, count: size_t) -> ssize_t; - - // ioLib.h or - // unistd.h - pub fn write(fd: c_int, buf: *const c_void, count: size_t) -> ssize_t; - - // ioLib.h or - // unistd.h - pub fn isatty(fd: c_int) -> c_int; - - // ioLib.h or - // unistd.h - pub fn dup(src: c_int) -> c_int; - - // ioLib.h or - // unistd.h - pub fn dup2(src: c_int, dst: c_int) -> c_int; - - // ioLib.h or - // unistd.h - pub fn pipe(fds: *mut c_int) -> c_int; - - // ioLib.h or - // unistd.h - pub fn unlink(pathname: *const c_char) -> c_int; - - // unistd.h and - // ioLib.h - pub fn lseek(fd: c_int, offset: off_t, whence: c_int) -> off_t; - // netdb.h pub fn getaddrinfo( node: *const c_char, @@ -2125,21 +2061,12 @@ extern "C" { // signal.h pub fn signal(signum: c_int, handler: sighandler_t) -> sighandler_t; - // unistd.h - pub fn getpid() -> pid_t; - - // unistd.h - pub fn getppid() -> pid_t; - // unistd.h pub fn setpgid(pid: pid_t, pgid: pid_t) -> pid_t; // wait.h pub fn waitpid(pid: pid_t, status: *mut c_int, options: c_int) -> pid_t; - // unistd.h - pub fn sysconf(attr: c_int) -> c_long; - // stdlib.h pub fn setenv( // setenv.c @@ -2157,21 +2084,9 @@ extern "C" { // stdlib.h pub fn realpath(fileName: *const c_char, resolvedName: *mut c_char) -> *mut c_char; - // unistd.h - pub fn link(src: *const c_char, dst: *const c_char) -> c_int; - - // unistd.h - pub fn readlink(path: *const c_char, buf: *mut c_char, bufsize: size_t) -> ssize_t; - - // unistd.h - pub fn symlink(path1: *const c_char, path2: *const c_char) -> c_int; - // dirent.h pub fn opendir(name: *const c_char) -> *mut crate::DIR; - // unistd.h - pub fn rmdir(path: *const c_char) -> c_int; - // stat.h pub fn mkdir(dirName: *const c_char, mode: mode_t) -> c_int; @@ -2181,9 +2096,6 @@ extern "C" { // stat.h pub fn fchmod(attr1: c_int, attr2: mode_t) -> c_int; - // unistd.h - pub fn fsync(fd: c_int) -> c_int; - // dirent.h pub fn closedir(ptr: *mut crate::DIR) -> c_int; @@ -2221,21 +2133,6 @@ extern "C" { // errnoLib.h pub fn errnoGet() -> c_int; - // unistd.h - pub fn _exit(status: c_int) -> !; - - // unistd.h - pub fn setgid(gid: crate::gid_t) -> c_int; - - // unistd.h - pub fn getgid() -> crate::gid_t; - - // unistd.h - pub fn setuid(uid: crate::uid_t) -> c_int; - - // unistd.h - pub fn getuid() -> crate::uid_t; - // signal.h pub fn sigemptyset(__set: *mut sigset_t) -> c_int; pub fn sigfillset(set: *mut sigset_t) -> c_int;