123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317 |
| /**
* D header file for POSIX.
*
* Copyright: Public Domain
* License: Public Domain
* Authors: Sean Kelly
* Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
*/
module tango.stdc.posix.unistd;
private import tango.stdc.posix.config;
private import tango.stdc.stddef;
public import tango.stdc.posix.inttypes; // for intptr_t
public import tango.stdc.posix.sys.types; // for size_t, ssize_t, uid_t, gid_t, off_t, pid_t, useconds_t
public import tango.sys.consts.unistd;
extern (C):
const STDIN_FILENO = 0;
const STDOUT_FILENO = 1;
const STDERR_FILENO = 2;
__gshared char* optarg;
__gshared int optind;
__gshared int opterr;
__gshared int optopt;
int access(in char*, int);
uint alarm(uint);
int chdir(in char*);
int chroot(in char*);
int chown(in char*, uid_t, gid_t);
int close(int);
size_t confstr(int, char*, size_t);
int dup(int);
int dup2(int, int);
int execl(in char*, in char*, ...);
int execle(in char*, in char*, ...);
int execlp(in char*, in char*, ...);
int execv(in char*, in char**);
int execve(in char*, in char**, in char**);
int execvp(in char*, in char**);
void _exit(int);
int fchown(int, uid_t, gid_t);
pid_t fork();
c_long fpathconf(int, int);
//int ftruncate(int, off_t);
char* getcwd(char*, size_t);
gid_t getegid();
uid_t geteuid();
gid_t getgid();
int getgroups(int, gid_t *);
int gethostname(char*, size_t);
char* getlogin();
int getlogin_r(char*, size_t);
int getopt(int, in char**, in char*);
pid_t getpgrp();
pid_t getpid();
pid_t getppid();
uid_t getuid();
int isatty(int);
int link(in char*, in char*);
//off_t lseek(int, off_t, int);
c_long pathconf(in char*, int);
int pause();
int pipe(int*);
ssize_t read(int, void*, size_t);
ssize_t readlink(in char*, char*, size_t);
int rmdir(in char*);
int setegid(gid_t);
int seteuid(uid_t);
int setgid(gid_t);
int setpgid(pid_t, pid_t);
pid_t setsid();
int setuid(uid_t);
uint sleep(uint);
int symlink(in char*, in char*);
c_long sysconf(int);
pid_t tcgetpgrp(int);
int tcsetpgrp(int, pid_t);
char* ttyname(int);
int ttyname_r(int, char*, size_t);
int unlink(in char*);
ssize_t write(int, in void*, size_t);
version( linux )
{
static if( __USE_LARGEFILE64 )
{
off_t lseek64(int, off_t, int);
alias lseek64 lseek;
}
else
{
off_t lseek(int, off_t, int);
}
static if( __USE_LARGEFILE64 )
{
int ftruncate64(int, off_t);
alias ftruncate64 ftruncate;
}
else
{
int ftruncate(int, off_t);
}
}
else version( FreeBSD )
{
off_t lseek(int, off_t, int);
int ftruncate(int, off_t);
}
else version( solaris )
{
static if( __USE_LARGEFILE64 )
{
off_t lseek64(int, off_t, int);
alias lseek64 lseek;
}
else
{
off_t lseek(int, off_t, int);
}
static if( __USE_LARGEFILE64 )
{
int ftruncate64(int, off_t);
alias ftruncate64 ftruncate;
}
else
{
int ftruncate(int, off_t);
}
}
else
{
off_t lseek(int, off_t, int);
int ftruncate(int, off_t);
}
//
// File Synchronization (FSC)
//
int fsync(int);
//
// Synchronized I/O (SIO)
//
int fdatasync(int);
//
// XOpen (XSI)
//
/*
char* crypt(in char*, in char*);
char* ctermid(char*);
void encrypt(char[64], int);
int fchdir(int);
c_long gethostid();
pid_t getpgid(pid_t);
pid_t getsid(pid_t);
char* getwd(char*); // LEGACY
int lchown(in char*, uid_t, gid_t);
int lockf(int, int, off_t);
int nice(int);
ssize_t pread(int, void*, size_t, off_t);
ssize_t pwrite(int, in void*, size_t, off_t);
pid_t setpgrp();
int setregid(gid_t, gid_t);
int setreuid(uid_t, uid_t);
void swab(in void*, void*, ssize_t);
void sync();
int truncate(in char*, off_t);
useconds_t ualarm(useconds_t, useconds_t);
int usleep(useconds_t);
pid_t vfork();
*/
version( linux )
{
char* crypt(in char*, in char*);
char* ctermid(char*);
void encrypt(char[64], int);
int fchdir(int);
c_long gethostid();
pid_t getpgid(pid_t);
pid_t getsid(pid_t);
char* getwd(char*); // LEGACY
int lchown(in char*, uid_t, gid_t);
//int lockf(int, int, off_t);
int nice(int);
//ssize_t pread(int, void*, size_t, off_t);
//ssize_t pwrite(int, in void*, size_t, off_t);
pid_t setpgrp();
int setregid(gid_t, gid_t);
int setreuid(uid_t, uid_t);
void swab(in void*, void*, ssize_t);
void sync();
//int truncate(in char*, off_t);
useconds_t ualarm(useconds_t, useconds_t);
int usleep(useconds_t);
pid_t vfork();
static if( __USE_LARGEFILE64 )
{
int lockf64(int, int, off_t);
alias lockf64 lockf;
ssize_t pread64(int, void*, size_t, off_t);
alias pread64 pread;
ssize_t pwrite64(int, in void*, size_t, off_t);
alias pwrite64 pwrite;
int truncate64(in char*, off_t);
alias truncate64 truncate;
}
else
{
int lockf(int, int, off_t);
ssize_t pread(int, void*, size_t, off_t);
ssize_t pwrite(int, in void*, size_t, off_t);
int truncate(in char*, off_t);
}
}
else version (darwin)
{
char* crypt(in char*, in char*);
char* ctermid(char*);
void encrypt(char[64], int);
int fchdir(int);
c_long gethostid();
pid_t getpgid(pid_t);
pid_t getsid(pid_t);
char* getwd(char*); // LEGACY
int lchown(in char*, uid_t, gid_t);
int lockf(int, int, off_t);
int nice(int);
ssize_t pread(int, void*, size_t, off_t);
ssize_t pwrite(int, in void*, size_t, off_t);
pid_t setpgrp();
int setregid(gid_t, gid_t);
int setreuid(uid_t, uid_t);
void swab(in void*, void*, ssize_t);
void sync();
int truncate(in char*, off_t);
useconds_t ualarm(useconds_t, useconds_t);
int usleep(useconds_t);
pid_t vfork();
}
else version (FreeBSD)
{
char* crypt(in char*, in char*);
//char* ctermid(char*);
void encrypt(char*, int);
int fchdir(int);
c_long gethostid();
int getpgid(pid_t);
int getsid(pid_t);
char* getwd(char*); // LEGACY
int lchown(in char*, uid_t, gid_t);
int lockf(int, int, off_t);
int nice(int);
ssize_t pread(int, void*, size_t, off_t);
ssize_t pwrite(int, in void*, size_t, off_t);
int setpgrp(pid_t, pid_t);
int setregid(gid_t, gid_t);
int setreuid(uid_t, uid_t);
void swab(in void*, void*, ssize_t);
void sync();
int truncate(in char*, off_t);
useconds_t ualarm(useconds_t, useconds_t);
int usleep(useconds_t);
pid_t vfork();
}
else version (solaris)
{
char* crypt(in char*, in char*);
//char* ctermid(char*);
void encrypt(char*, int);
int fchdir(int);
c_long gethostid();
int getpgid(pid_t);
int getsid(pid_t);
char* getwd(char*); // LEGACY
int lchown(in char*, uid_t, gid_t);
int nice(int);
int setpgrp(pid_t, pid_t);
int setregid(gid_t, gid_t);
int setreuid(uid_t, uid_t);
void swab(in void*, void*, ssize_t);
void sync();
useconds_t ualarm(useconds_t, useconds_t);
int usleep(useconds_t);
pid_t vfork();
static if( __USE_LARGEFILE64 )
{
int lockf64(int, int, off_t);
alias lockf64 lockf;
ssize_t pread64(int, void*, size_t, off_t);
alias pread64 pread;
ssize_t pwrite64(int, in void*, size_t, off_t);
alias pwrite64 pwrite;
int truncate64(in char*, off_t);
alias truncate64 truncate;
}
else
{
int lockf(int, int, off_t);
ssize_t pread(int, void*, size_t, off_t);
ssize_t pwrite(int, in void*, size_t, off_t);
int truncate(in char*, off_t);
}
}
|