int attach( const TC *devnm, const char *connm, int mode )
int detach( const TC *devnm, int eject )
int mount(int type, const char *path, int flags, void *data)
int unmount(const char *path, int flags)
int creat(const char *path, mode_t mode)
int open( const char *path, int oflag, .../*int mode*/ )
int close( int fildes )
off_t lseek( int fildes, off_t offset, int whence )
ssize_t read( int fildes, void *buf, size_t nbyte )
ssize_t write( int fildes, const void *buf, size_t nbyte )
size_t readv(int fd, const struct iovec *iovp, int iovcnt)
int writev(int fd, const struct iovec *iovp, int iovcnt)
int unlink(const char *path)
int rename(const char *from, const char *to)
int truncate(const char *path, off_t length)
int ftruncate(int fd, off_t length)
int utimes(const char *path, const struct timeval *tptr)
long pathconf(const char *path, int name)
int stat(const char *path, struct stat *ub)
int fstat(int fd, struct stat *sb)
int lstat(const char *path, struct stat *ub)
int mkdir(const char *path, mode_t mode)
int rmdir(const char *path)
int getdents( int fildes, struct dirent *buf, size_t nbyte )
int getdirentries(int fd, char *buf, int count, long *basep)
int chroot(const char *path)
int chdir(const char *path)
int fchdir(int fd)
int sigaction(int signum, const struct sigaction *nsa, struct sigaction *osa)
int sigprocmask(int how, const sigset_t *set, sigset_t *oset)
int fcntl(int fd, int cmd, ...)
int ioctl(int fd, unsigned long request, ...)
int symlink(const char *path, const char *link)
int readlink(const char *path, char *buf, int count)
int btron_prefork(void)
int btron_forkexecve(const char *fname, char * const *argv, char * const *envv)
pid_t wait( int *statusp)
int dup(int fd)
int dup2(int from, int to)
int pipe(int *fd)
pid_t getpid(void)
pid_t getppid(void)
int setitimer(int which, const struct itimerval *itv, struct itimerval *oitv)
int getitimer(int which, struct itimerval *itv)
int gettimeofday(struct timeval *tp, struct timezone *tzp)
int getrusage(int who, struct rusage *rusage)
int getdtablesize(void)
int getlink( const char *path, char *buf )
attach
,detach
,getlink
$B0J30$O!"(B
$B4pK\E*$K(BUNIX$B$NF1L>$N%7%9%F%`%3!<%k$HF1Ey$N5!G=$G$"$k$,!"(B
$BA4$F$N5!G=$,$B>e5-0J30$K$b!"(BUNIX$B$N%7%9%F%`%3!<%k$KBP1~$9$k%@%_!<$N4X?t$r$$$/$D$+$rDs6!$7$F$$$k!#(B
$B%U%!%$%k$r;X$9%Q%9L>$O!"0J2<$N7A<0$K$J$k!#(B
/$B@\B3L>(B/$B%G%#%l%/%H%jL>(B/$B%U%!%$%kL>(B.$B3HD%;R(B
($BNc(B) "/CD/DIR_1/FILE.EXT"
- $BJ8;z%3!<%I$O!"F|K\8l(B EUC
- $B6h@Z$j%3!<%I$N(B "/", " ." $B$O!"H>3QJ8;z(B(ASCII)
#include <bsys/unixemu.h>
int attach( const TC *devnm, const char *connm, int mode )
$B%G%P%$%9L>(Bdevnm
$B$N%G%P%$%9$r@\B3L>(Bconnm
$B!"(B
$B@\B3%b!<%I(Bmode
$B$G@\B3$9$k!#(B
$B@\B3L>$O!":GBg(B 16 $B%P%$%H!#(B
mode := (UX_BTRON$B!B(BUX_MSDOS$B!B(BUX_CDROM) | [UX_RONLY]
UX_RONLY | 0x0001 | $BFI$_=P$7$N$_(B |
UX_BTRON | 0x0000 | BTRON $B%U%!%$%k%7%9%F%`(B |
UX_MSDOS | 0x0100 | MS-DOS $B%U%!%$%k%7%9%F%`(B |
UX_CDROM | 0x0200 | CD-ROM $B%U%!%$%k%7%9%F%`(B |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
- $BHw9M(B:
- $B8=;~E@$G$O!"%U%!%$%k%7%9%F%`$H$7$F;XDj$G$-$k$N$O(B UX_CDROM $B$H(B UX_MSDOS$B$N#2$D$N$_$G$"$k!#$?$@$7!"$I$A$i$bFI$_=P$7$N$_$G!"=q$-9~$_$O$G$-$J$$!#(B
#include <bsys/unixemu.h>
int detach( const TC *devnm, int eject )
$B%G%P%$%9L>(B devnm
$B$N%G%P%$%9$r@ZCG$9$k!#(B
- $B0z?t(B
eject | 0 | $B%a%G%#%"$rGS=P$7$J$$(B |
| 1 | $B%a%G%#%"$rGS=P$9$k(B |
| $B$=$NB>(B | $BL$Dj5A(B($B;XDjIT2D(B) |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <sys/mount.h>
int mount(int type, const char *path, int flags, void *data)
$B%U%!%$%k%7%9%F%`$r%G%#%l%/%H%j$K@\B3$9$k!#@5>o=*N;$7$?>l9g!";XDj$7$?%G%#%l%/%H(B
$B%j$X$N%"%/%;%9$O%^%&%s%H$7$?%U%!%$%k%7%9%F%`$N%k!<%H%G%#%l%/%H%j$X$N%"%/%;%9$K(B
$B$J$k!#%^%&%s%HCf$O;XDj%G%#%l%/%H%j$N85$NFbMF$r;2>H$9$k;v$O=PMh$J$$!#(B
- $B0z?t(B
int type | $B%U%!%$%k%7%9%F%`$N%?%$%W!#(B |
| MOUNT_MSDOS | MS-DOS |
| MOUNT_CD9660 | CD-ROM |
| MOUNT_BTRONFS | BTRON |
const char *path | $B%^%&%s%H$9$k%G%#%l%/%H%j$r;XDj$9$kJ8;zNs!#(B |
int flags | $B0J2<$N%S%C%H$NO@M}OB!#(B |
| MNT_RDONLY | $B%U%!%$%k%7%9%F%`$rFI$_ |
| MNT_NOEXEC | $B%U%!%$%k%7%9%F%`$+$i$N |
| MNT_UNION | $B%U%!%$%k%7%9%F%`$r%U%!%$%k%7%9%F%`%D%j!<$N0lIt$H8+$J$9!#(B |
void *data | $B%G%P%$%9L>$NJ8;zNs$X$N%]%$%s%?!#(B"fda"$B$J$I!#(B |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
- $BHw9M(B:
- $B%U%!%$%k%7%9%F%`$N(B type $B$H;XDj$G$-$k(B flags $B$K$O@)8B$,$"$k!#(BMS-DOS$B!"(BCD-ROM $B%U%!%$%k%7%9%F%`$K$D$$$F$OFI$_=P$7@lMQ$G$"$k!#(B
#include <sys/mount.h>
int unmount(const char *path, int flags)
$B%^%&%s%H$7$F$$$?%U%!%$%k%7%9%F%`$r%^%&%s%H2r=|$9$k!#(B
- $B0z?t(B
const char *path | $B%^%&%s%H2r=|$9$k%U%!%$%k%7%9%F%`$,%^%&%s%H$7$F$$$k%G%#%l%/%H%j$N%Q%9!#(B |
int flags | MNT_FORCE: $B6/@)2r=|(B |
|
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <fcntl.h>
int creat(const char *path, mode_t mode)
$BDL>o%U%!%$%k$N?75,:n@.!"$^$?$O(Bpath
$B$,;X$9%Q%9L>$K$h$C$F;XDj$5$l$?4{B8%U%!%$%k(B
$B$r%*!<%W%s$7$^$9!#?75,:n@.$N>l9g$O!"%W%m%;%9!&%b!<%I!&%^%9%/$K$h$j=$@5$5$l$?%b(B
$B!<%I(Bmode
$B$,M?$($i$l$^$9!#(B
- $B0z?t(B
const char *path | $B?75,$K:n@.$9$k%U%!%$%k$N%Q%9!#(B |
mode_t mode | $B%U%!%$%k%b!<%I!#(B |
- $BLa$jCM(B
>=0 | $B%U%!%$%k%G%#%9%/%j%W%?!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <fcntl.h>
int open( const char *path, int oflag, .../*int mode*/ )
$B%Q%9L>(Bpath
$B$N%U%!%$%k!?%G%#%l%/%H%j$r%*!<%W%s%b!<%I(Boflag
$B$G%*!<%W%s$9$k!#(B
oflag
$B$K$O!"
O_RDONLY | 0x0000 | $BFI$_9~$_$N$_(B |
O_WRONLY | 0x0001 | $B=q$-9~$_$N$_(B |
O_RDWR | 0x0002 | $BFI$_9~$_=q$-9~$_(B |
oflag
$B$K$O!"%*%W%7%g%s$H$7$Fe5-$H(B OR $B$G;XDj$G$-$k!#(B
O_CREAT | 0x0200 | $B%U%!%$%k$,$J$1$l$P%U%!%$%k@8@.(B
$B%U%!%$%k$,$J$1$l$P%U%!%$%k$r@8@.$9$k!#%U%!%$%k$,$9$G$K$"$k>l9g$K$O$3$N%U%i%0$O2?$N8z2L$b$J$$!#(Bmode$B$G;XDj$5$l$?%b!<%I$G%U%!%$%k$r@8@.$9$k(B |
O_TRUNC | 0x0400 | $B%U%!%$%kFbMF:o=|(B
$B%U%!%$%k$NFbMF$rGK4~$7!"%U%!%$%k%5%$%:$r(B0$B$K$9$k!#%G%#%l%/%H%j$KBP$7$F;XDj$7$?>l9g$OL5;k$5$l$k!#(B |
O_EXCL | 0x0800 | $B%U%!%$%k$,$"$l$P%(%i!<(B
O_CREAT $B$H9g$o$;$F;XDj$9$k!#%U%!%$%k$,$9$G$K$"$k>l9g$O!"%(%i!<$H$9$k!#(B |
- $BLa$jCM(B
>=0 | $B%U%!%$%k%G%#%9%/%j%W%?!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <unistd.h>
int close( int fildes )
$B%U%!%$%k%G%#%9%/%j%W%?(Bfildes
$B$N%U%!%$%k!?%G%#%l%/%H%j$r%/%m!<%:$9$k!#(B
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <unistd.h>
off_t lseek( int fildes, off_t offset, int whence )
$B%U%!%$%k%G%#%9%/%j%W%?(Bfildes
$B$N%U%!%$%k(B / $B%G%#%l%/%H%j%]%$%s%?(B
( $B%P%$%HC10L$N0LCV(B ) $B$r0\F0$9$k!#(B
whence | SEEK_SET (0) | offset $B$N0LCV$K0\F0(B |
whence | SEEK_CUR (1) | $B8=:_0LCV(B + offset $B$K0\F0(B |
whence | SEEK_END (2) | $B=*C<(B + offset $B$K0\F0(B |
- $BLa$jCM(B
>=0 | $B@5>o=*N;!#0\F08e$N0LCV!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <unistd.h>
ssize_t read( int fildes, void *buf, size_t nbyte )
$B%U%!%$%k%G%#%9%/%j%W%?(Bfildes
$B$N%U%!%$%k$N8=:_0LCV$+$i(Bnbyte
$B%P%$%H$r(Bbuf
$B$XFI$_9~$`!#FI$_9~$s$@%P%$%H?tJ,!"%U%!%$%k$N8=:_0LCV$r?J$a$k!#(B
- $BLa$jCM(B
>=0 | $BFI$_9~$s$@%P%$%H?t!#(B0 $B$O%U%!%$%k$N=*C<$r<($9!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <unistd.h>
ssize_t write( int fildes, const void *buf, size_t nbyte )
$B%U%!%$%k%G%#%9%/%j%W%?(Bfildes
$B$N%U%!%$%k$N8=:_0LCV$+$i(B
nbyte
$B%P%$%H$X(Bbuf
$B$r=q$-9~$`!#(B
$B=q$-9~$s$@%P%$%H?tJ,!"%U%!%$%k$N8=:_0LCV$r?J$a$k!#(B
- $BLa$jCM(B
>=0 | $B@5>o=*N;!#=q$-9~$s$@%P%$%H?t!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <sys/types.h>
#include <sys/uio.h>
size_t readv(int fd, const struct iovec *iovp, int iovcnt)
$B%U%!%$%k%G%#%9%/%j%W%?(Bfd
$B$,<($9%U%!%$%k$+$i(Biovp
$B$K5-O?$5$l$?(Biov
$BG[Ns$N%a%s%P$,;XDj$7$?%P%C%U%!$X%G!<%?$rFI$_9~$`!#(B
- $B0z?t(B
-
int fd | $B%U%!%$%k%G%#%9%/%j%W%?(B |
const struct iovec *iovp iovec | $B9=B$BNG[Ns$X$N%]%$%s%?!#(B |
int iovcnt | iovec $BG[Ns$N%$%s%G%C%/%9?t!#(B |
- $BLa$jCM(B
>=0 | $B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <sys/types.h>
#include <sys/uio.h>
int writev(int fd, const struct iovec *iovp, int iovcnt)
$B%U%!%$%k%G%#%9%/%j%W%?(Bfd
$B$,<($9%U%!%$%k$X(Biovp
$B$K5-O?$5$l$?(Biov
$BG[Ns$N%a%s%P$,;XDj$7$?%P%C%U%!$+$i%G!<%?$r=q$-9~$`!#(B
- $B0z?t(B
-
int fd | $B%U%!%$%k%G%#%9%/%j%W%?(B |
const struct iovec *iovp | iovec $B9=B$BNG[Ns$X$N%]%$%s%?!#(B |
int iovcnt | iovec $BG[Ns$N%$%s%G%C%/%9?t!#(B |
- $BLa$jCM(B
>=0 | $B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <unistd.h>
int unlink(const char *path)
$B%Q%9L>(Bpath
$B$N%U%!%$%k$r:o=|$9$k!#(B
- $B0z?t(B
-
const char *path | $B:o=|$9$k%U%!%$%k$r;XDj$9$k%Q%9!#(B |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <stdio.h>
int rename(const char *from, const char *to)
from
$B$,;X$9%Q%9$r(Bto
$B$K%j%M!<%`$9$k!#(B
- $B0z?t(B
const char *from | $B%j%M!<%`$9$k%Q%9!#(B |
const char *to | $B%j%M!<%`8e$N%Q%9(B |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
- $BHw9M(B:
- $B8=>u$N%$%s%W%j%a%s%H$G$OF10l%G%#%l%/%H%j$K$*$1$k%j%M!<%`$N$_$KBP1~$7$F$$$k!#(B
#include <sys/types.h>
int truncate(const char *path, off_t length)
- $B0z?t(B
const char *path | $B%U%!%$%k%5%$%:$rJQ99$9$k%U%!%$%k$N%Q%9!#(B |
off_t length | $BJQ99$9$k%5%$%:!#(B |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <sys/types.h>
int ftruncate(int fd, off_t length)
- $B0z?t(B
int fd | $B%U%!%$%k%5%$%:$rJQ99$9$k%U%!%$%k$N%U%!%$%k%G%#%9%/%j%W%?!#(B |
off_t length | $BJQ99$9$k%5%$%:!#(B |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <sys/time.h>
int utimes(const char *path, const struct timeval *tptr)
path
$B$G;XDj$7$?%U%!%$%k$NJQ99;~4V$r@_Dj$9$k!#(B
- $B0z?t(B
const char *path | $BBP>]%U%!%$%k$N%Q%9!#(B |
const struct timeval *tptr | $BJQ99$9$k;~4V$r3JG<$7$?9=B$BN$X$N%]%$%s%?!#(B |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
- $BHw9M(B:
- $B8=>uJQ992DG=$J$N$OJQ99;~4V$N$_!#%"%/%;%9;~4V$O@_Dj$G$-$J$$!#(B
#include <unistd.h>
long pathconf(const char *path, int name)
- $B0z?t(B
const char *path | $B%U%!%$%k(B/$B%G%#%l%/%H%j$N%Q%9!#(B |
int name | $B@)8BCM$N |
- $BLa$jCM(B
0 | $B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <sys/types.h>
#include <sys/stat.h>
int stat(const char *path, struct stat *ub)
path
$B$G;XDj$7$?%U%!%$%k$K4X$9$k>pJs$r
- $B0z?t(B
const char *path | $BBP>]%U%!%$%k$r;XDj$9$k%Q%9!#(B |
struct stat *ub | stat$B9=B$BN$r;X$9%]%$%s%?!#(B |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
- $BHw9M(B:
- UNIX$B%U%!%$%k%7%9%F%`$H(B BTRON $B%U%!%$%k%7%9%F%`$NAj0c$K$h$j!"(B
stat
$B9=B$BN$K3JG<$5$l$k>pJs$O$9$Y$FM-8z$J$o$1$G$O$J$$!#(B
$B%$%s%W%j%a%s%H$NET9g>e%U%!%$%k$N%"%/%;%9;~4V$O0U?^$7$J$$%?%$%_%s%0$G(B
$B99?7$5$l$k$3$H$,$"$k!#(B
__dev_t st_dev $B%G%P%$%9(BID
ino_t st_ino $B%U%!%$%k(BID
mode_t st_mode $B%U%!%$%k%b!<%I(B
nlink_t st_nlink $B%U%!%$%k$N;2>H%+%&%s%H(B
uid_t st_uid $B>o$K(B0
gid_t st_gid $B>o$K(B0
__dev_t st_rdev $B>o$K(B0
struct timespec st_atimespec $B%U%!%$%k$N:G8e$N%"%/%;%9;~4V(B
struct timespec st_mtimespec $B%U%!%$%k$N:G8e$NJQ99;~4V(B
struct timespec st_ctimespec $B%U%!%$%k$N@8@.;~4V(B
off_t st_size $B%U%!%$%k(B/$B%l%3!<%I$N%5%$%:(B
int64_t st_blocks $B%U%!%$%k$K3d$jEv$F$i$l$F$$$k%V%m%C%/?t(B
u_int32_t st_blksize $BO@M}%V%m%C%/$N%P%$%H?t(B
u_int32_t st_flags $B>o$K(B0
u_int32_t st_gen $B>o$K(B0
int32_t st_lspare $BL$;HMQ(B
int64_t st_qspare[2] $BL$;HMQ(B
#include <sys/types.h>
#include <sys/stat.h>
int fstat(int fd, struct stat *sb)
$B0z?t$N%U%!%$%k%G%#%9%/%j%W%?$,;2>H$9$k%*!<%W%s%U%!%$%k$N%U%!%$%k>pJs$rstat()$B$r;2>H!#(B
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <sys/types.h>
#include <sys/stat.h>
int lstat(const char *path, struct stat *ub)
path
$B$G;XDj$7$?%U%!%$%k$K4X$9$k>pJs$rstat()$B$HF1$8!#(B
$B%7%s%\%j%C%/%j%s%/$N>l9g$O%j%s%/$K$D$$$F$N>pJs$rJV$9!#(Bstat()
$B;2>H!#(B
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <sys/types.h>
#include <sys/stat.h>
int mkdir(const char *path, mode_t mode)
- $B0z?t(B
const char *path | $B:n@.$9$k%G%#%l%/%H%j$N%Q%9!#(B |
mode_t mode | $B:n@.$9$k%G%#%l%/%H%j$N%b!<%I%^%9%/!#(B |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
- $BHw9M(B:
mode
$B$OL58z!#(B
#include <unistd.h>
int rmdir(const char *path)
path
$B$G;XDj$7$?%G%#%l%/%H%j$r:o=|$9$k!#(B
$B%G%#%l%/%H%j$K$O(B "." ".." $B0J30$N%(%s%H%j$,$"$C$F$O$J$i$J$$!#(B
$B$^$?!"%k!<%H%G%#%l%/%H%j!"8F$S=P$7%W%m%;%9$N%+%l%s%H%G(B
$B%#%l%/%H%j$G$"$C$F$O$J$i$J$$!#(B
- $B0z?t(B
const char *path | $B:o=|$9$k%G%#%l%/%H%j!#(B |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <sys/types.h>
#include <sys/dirent.h>
int getdents( int fildes, struct dirent *buf, size_t nbyte )
struct dirent {
unsigned int d_fileno; /* $B%U%!%$%kHV9f(B */
unsigned short d_reclen; /* $B%l%3!<%ID9(B */
unsigned char d_type; /* $B%U%!%$%k%?%$%W(B */
unsigned char d_namlen; /* d_name $B$NJ8;zNsD9(B */
char d_name[255+1]; /* $BL>A0(B */
};
/* $B%U%!%$%k%?%$%W(B */
#define DT_UNKNOWN 0 /* $BITL@(B */
#define DT_DIR 4 /* $B%G%#%l%/%H%j(B */
#define DT_REG 8 /* $BIaDL$N%U%!%$%k(B */
$B%U%!%$%k%G%#%9%/%j%W%?(B fildes $B$N%G%#%l%/%H%j$N8=:_0LCV$+$i%G%#%l%/%H%j%(%s%H%j(B
$B!<(B($B%l%3!<%I(B)$B$r0l$DFI$_9~$_!"(B struct dirent $B$N7A<0$KJQ49$7$F(B buf $B$X=q$-9~$`!#%G(B
$B%#%l%/%H%j$N8=:_0LCV$,l9g$O%(%i!<(B ( EINVAL ) $B$H$J$k!#(B
- $B0z?t(B
int filedes | $B |
struct dirent *buf | $B%G%#%l%/%H%j%(%s%H%j$r3JG<$9$k%P%C%U%!$N%"%I%l%9!#(B |
size_t nbyte | $B%P%C%U%!$N%5%$%:!#(B |
- $BLa$jCM(B
>=0 | $BE>Aw$7$?%P%$%H?t!#(B0 $B$O!"%G%#%l%/%H%j$N=*C<$r<($9!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
- $BHw9M(B:
- $BDL>o(B getdents()$B$OJ#?t%(%s%H%j$rJV$9;EMM$@$,!"(B
$B8=:_$N%$%s%W%j%a%s%H$OC10l$N%(%s%H%j$rJV$9$N$GCm0U!#(B
#include <dirent.h>
int getdirentries(int fd, char *buf, int count, long *basep)
fd
$B$G;XDj$7$?%G%#%l%/%H%j$+$i%G%#%l%/%H%j%(%s%H%j$r(B
struct dirent
$B$NJB$S$H$7$F(Bbuf
$B$K=q$-9~$`!#(B
- $B0z?t(B
int fd | $B |
char *buf | $B%G%#%l%/%H%j%(%s%H%j$r3JG<$9$k%P%C%U%!$N%"%I%l%9!#(B |
int count | $B%P%C%U%!$N%5%$%:!#(B |
long *basep | $BFI$_ |
- $BLa$jCM(B
>=0 | $BE>Aw$7$?%P%$%H?t!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <unistd.h>
int chroot(const char *path)
'/'$B$G;O$^$k%Q%9L>$r8!:w$9$k;OE@$rJQ99$9$k!#(B
$B%W%m%;%9$N%+%l%s%H%G%#%l%/%H%j$K1F6A$OM?$($J$$!#(B
- $B0z?t(B
const char *path | $BJQ998e$N%k!<%H%G%#%l%/%H%j$N%Q%9$rI=$9(B NULL $B=*C<$NJ8;zNs!#(B |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <unistd.h>
int chdir(const char *path)
$B%Q%9L>(Bpath
$B$N%G%#%l%/%H%j$K%+%l%s%H%G%#%l%/%H%j$r0\F0$9$k!#(B
- $B0z?t(B
const char *path | $B0\F0@h$N%G%#%l%/%H%j$r;XDj$9$k%Q%9!#(B |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <unistd.h>
int fchdir(int fd)
$B%U%!%$%k%G%#%9%/%j%W%?(Bfd
$B$N%G%#%l%/%H%j$K%+%l%s%H%G%#%l%/%H%j$r0\F0$9$k!#(B
- $B0z?t(B
int fd | $B0\F0@h$N%G%#%l%/%H%j$r;XDj$9$k%U%!%$%k%G%#%9%/%j%W%?!#(B |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <signal.h>
int sigaction(int signum, const struct sigaction *nsa, struct sigaction *osa)
$BFCDj$N%7%0%J%k$KBP1~$9$kF0:n$N8!::!"$*$h$S;XDj$r9T$&!#(B
- $B0z?t(B
int signum | $B%7%0%J%kHV9f(B |
const struct sigaction *nsa | NULL$B$G$J$$>l9g!";XDj$9$k%7%0%J%k$KBP1~$9$kF0:n$r;XDj$9$k9=B$BN$X$N%]%$%s%?(B |
struct sigaction *osa | NULL$B$G$J$$>l9g!";XDj$9$k%7%0%J%k$KBP1~$9$k0JA0$NF0:n$r3JG<$9$k9=B$BN$X$N%]%$%s%?(B |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <signal.h>
int sigprocmask(int how, const sigset_t *set, sigset_t *oset)
$B8F$S=P$7$?%W%m%;%9$N%7%0%J%k%^%9%/$r8!::!"@_Dj$9$k!#(B
set
$B$NCM$,(B NULL
$B$G$J$$>l9g!"(B
how
$B$NCM$K$h$C$F%W%m%;%9$N%7%0%J%k%^%9%/$rA`:n$9$k!#(B
- $B0z?t(B
int how | SIG_BLOCK: set$B$K$h$j;XDj$7$?%7%0%J%k=89g$r%W%m%;%9$N%7%0%J%k%^%9%/$K(B or $B$9$k!#(B |
| SIG_UNBLOCK: set$B$K$h$j;XDj$7$?%7%0%J%k=89gMQ$$$F%W%m%;%9$N%7%0%J%k%^%9%/$r%/%j%"$9$k!#(B |
| SIG_SETMASK: set$B$K$h$j;XDj$7$?%7%0%J%k=89gMQ$$$F%W%m%;%9$N%7%0%J%k%^%9%/$r=q$-49$($k!#(B |
const sigset_t *set | NULL $B$G$J$$>l9g!"%7%0%J%k=89g$r0UL#$9$k!#(B |
sigset_t *oset | NULL $B$G$J$$>l9g!"85$N%7%0%J%k%^%9%/CM$r%3%T!<$9$k!#(B |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
int fcntl(int fd, int cmd, ...)
$B%*!<%W%s5-=R;R>e$G$5$^$6$^$J5!G=$r\:Y$O(BUNIX$B%7%9%F%`%3!<%k$r;2>H(B
$B$N$3$H!#$?$@$7$9$Y$F$N5!G=$KBP1~$7$F$$$k$o$1$G$O$J$$!#(B
#include <sys/ioctl.h>
int ioctl(int fd, unsigned long request, ...)
$B%U%!%$%k%G%#%9%/%j%W%?(Bfd
$B$,;2>H$9$k%*%V%8%'%/%H$KBP$7$FFC
- $B0z?t(B
int fd | $B%U%!%$%k%G%#%9%/%j%W%?!#(B |
unsigned long request | $BA`:n |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
- $BHw9M(B:
- $B8=>uBP1~$7$F$$$k$N$O%3%s%=!<%k$KBP$9$kA`:n$N$_$G$"$k!#(B
TIOCGETA: $BCuBV$r(Btermios
$B9=B$BN$K3JG<$7
TIOCSETA: $BEO$7$?(Btermios
$B9=B$BN$K4p$E$-CuBV$r@_Dj$9$k!#(B
#include <unistd.h>
int symlink(const char *path, const char *link)
path
$B$G;XDj$7$?%U%!%$%k$KBP$7$F(Blink
$B$N%7%s%\%j%C%/%j%s%/$r:n@.$9$k!#(B
- $B0z?t(B
const char *path | $B%7%s%\%j%C%/%j%s%/$K$h$j;2>H$5$l$k%U%!%$%k(B/$B%G%#%l%/%H%j$N%Q%9!#(B |
const char *link | $B%7%s%\%j%C%/%j%s%/$N%Q%9L>!#(B |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <unistd.h>
int readlink(const char *path, char *buf, int count)
$B$G;XDj$7$?%7%s%\%j%C%/%j%s%/$NCM$r(Bbuf
$B$K3JG<$9$k!#(B
- $B0z?t(B
const char *path | $B%7%s%\%j%C%/%j%s%/$N%Q%9!#(B |
char *buf | $B%7%s%\%j%C%/%j%s%/$NCM$r3JG<$9$k%P%C%U%!$N%]%$%s%?!#CM$NKvHx$O(BNULL$B$,IU2C$5$l$J$$!#(B |
int count | buf $B$N%5%$%:!#(B |
- $BLa$jCM(B
>=0 | $B%P%C%U%!$K3JG<$5$l$?J8;zNs$N%P%$%H?t!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <bsys/unixemu.h>
int btron_prefork(void)
$B<+%W%m%;%9$N4D6-$rJ#@=$7!";R%W%m%;%95/F0$NMQ0U$r$7$^$9!#(B
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <bsys/unixemu.h>
int btron_forkexecve(const char *fname, char * const *argv, char * const *envv)
fname
$B$G;XDj$7$?%W%m%0%i%`$r5/F0$9$k!#(B
- $B0z?t(B
const char *fname | $B5/F0$9$k%W%m%0%i%`%U%!%$%k$N%Q%9!#(B |
char * const *argv | $B?7%W%m%;%9$KEO$90z?t%j%9%H!#(BNULL$B=*C<$NJ8;zNs$r;X$9%]%$%s%?$+$i$J$k(BNULL$B$G=*C<$9$kG[Ns$N%]%$%s%?!#(B |
char * const *envv | $B?7%W%m%;%9$KEO$94D6-JQ?t%j%9%H!#(BNULL$B=*C<$NJ8;zNs$r(B $B;X$9%]%$%s%?$+$i$J$k(BNULL$B$G=*C<$9$kG[Ns$N%]%$%s%?!#(B |
- $BLa$jCM(B
>=0 | $B5/F0$7$?;R%W%m%;%9$N%W%m%;%9(BID$B!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <sys/wait.h>
pid_t wait( int *statusp)
$B%7%0%J%k$rwait()
$B$r;HMQ$7$FDLCN$5$l$F$$$J$$>l9g$O$=$N$h$&$J;R%W%m%;%9$N$&$A$N0l$D$N%W%m%;%9(BID$B$H(B
$B=*N;%9%F!<%?%9$r3JG<$7$F$9$0$KJV$k!#;R%W%m%;%9$,$J$$>l9g$O$9$0$KJV$k!#(B
$B@5>o=*N;$7$?>l9g$G(B statusp
$B$,(B NULL$B$G$J$$>l9g$O(B wait()
$B$NLa$jCM$GI=$5$l$k;R%W%m%;%9$N=*N;%9%F!<%?%9$,(Bstatusp
$B$G<($5$l$k>l=j$K3JG<$5$l$k!#(B
- $B0z?t(B
int *statusp | $B;R%W%m%;%9$N=*N;%9%F!<%?%9$r5-O?$9$k%a%b%j$X$N%]%$%s%?(B |
- $BLa$jCM(B
>0 | $B;R%W%m%;%9(BID$B!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <unistd.h>
int dup(int fd)
fd
$B$7$?%U%!%$%k%G%#%9%/%j%W%?$rJ#@=$7!"La$jCM$H$7$FJV$9!#(B
$BJV$5$l$k%U%!%$%k%G%#%9%/%j%W%?$O!"8=:_%W%m%;%9$G;HMQ$5$l$F$$$J$$(B
$B%U%!%$%k%G%#%9%/%j%W%?$N$&$A:G2<0L$NHV9f$G$"$k!#(B
- $B0z?t(B
int fd | $BJ#@=$9$k%U%!%$%k%G%#%9%/%j%W%?!#(B |
- $BLa$jCM(B
>=0 | $B@5>o=*N;!#J#@=$5$l$?%U%!%$%k%G%#%9%/%j%W%?!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <unistd.h>
int dup2(int from, int to)
$B%U%!%$%k%G%#%9%/%j%W%?(B from $B$r(B to $B$KJ#@=$9$k!#(Bto $B$,4{$K;HMQ$5$l$F$$$k>l9g$O(B cl
ose() $B$G%/%m!<%:$7$?$+$N$h$&$K$=$N3d$jEv$F$r2r=|$7$?8eJ#@=$5$l$k!#(B
- $B0z?t(B
int from | $BJ#@=$9$k%U%!%$%k%G%#%9%/%j%W%?!#(B |
int to | $BJ#@=8e$N%U%!%$%k%G%#%9%/%j%W%?!#(B |
- $BLa$jCM(B
>=0 | $BJ#@=8e$N%U%!%$%k%G%#%9%/%j%W%?!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <unistd.h>
int pipe(int *fd)
$B%Q%$%W$r@8@.$7!"(Bfd[0]$B!"(Bfd[1]
$B$KFs$D$N%U%!%$%k%G%#%9%/%j%W%?$r3JG<$9$k!#(B
fd[0]
$B$OFI$_fd[1]$B$O=q$-9~$_MQ$K%*!<%W%s$5$l$k!#(B
- $B0z?t(B
int *fd | int$BG[Ns$X$N%]%$%s%?!#(B |
- $BLa$jCM(B
>=0 | $BJ#@=8e$N%U%!%$%k%G%#%9%/%j%W%?!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <unistd.h>
pid_t getpid(void)
$B%+%l%s%H%W%m%;%9$N%W%m%;%9(BID$B$r
- $BLa$jCM(B
$B%+%l%s%H%W%m%;%9$N%W%m%;%9(BID |
#include <unistd.h>
pid_t getppid(void)
$B%+%l%s%H%W%m%;%9$N?F%W%m%;%9(BID$B$r
- $BLa$jCM(B
$B%+%l%s%H%W%m%;%9$N?F%W%m%;%9(BID$B!#(B |
#include <sys/time.h>
int setitimer(int which, const struct itimerval *itv, struct itimerval *oitv)
- $B0z?t(B
int which | $B@_Dj$9$k%$%s%?!<%P%k%?%$%^!<7?!#(B |
const struct itimerval *itv | NULL$B$G$J$$>l9g!"%$%s%?!<%P%k%?%$%^!<$r@_Dj$9$k9=B$BN$X$N%]%$%s%?!#(B |
struct itimerval *oitv | NULL$B$G$J$$>l9g!"$3$l$^$G$N%$%s%?!<%P%k%?%$%^!<$N@_Dj$r3JG<$9$k%"%I%l%9!#(B |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <sys/time.h>
int getitimer(int which, struct itimerval *itv)
- $B0z?t(B
int which | $B |
struct itimerval *itv | NULL$B$G$J$$>l9g!"$3$l$^$G$N%$%s%?!<%P%k%?%$%^!<$N@_Dj$r3JG<$9$k%"%I%l%9(B |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <time.h>
int gettimeofday(struct timeval *tp, struct timezone *tzp)
$B8=:_$N%0%j%K%C%8;~4V$r(B1970$BG/(B1$B7n(B1$BF|(B0000$B$+$i7P2a$7$?IC$H%^%$%/%mICC10L$G5a$a$k!#(B
- $B0z?t(B
struct timeval *tp | $B%G!<%?$rJ]B8$9$k(B timeval $B9=B$BN$X$N%]%$%s%?!#(BNULL$B$N>l9g$OL5;k$5$l$k!#(B |
struct timezone *tzp | $B%?%$%`%>!<%s$OGQ;_$5$l$?!#(B |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <sys/resource.h>
int getrusage(int who, struct rusage *rusage)
$B%+%l%s%H%W%m%;%9$K$h$C$FMxMQ$5$l$?;q8;$K4X$9$k>pJs$r
- $B0z?t(B
int who | RUSAGE_SELF $B%+%l%s%H%W%m%;%9!#(B |
struct rusage *rusage | $B>pJs$r3JG<$9$k9=B$BN$X$N%]%$%s%?!#(B |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
- $BHw9M(B:
- who $B$O(B RUSAGE_SELF $B$N$_!"(Bstruct rusage $B$O(B ru_utime, ru_stime $B$N$_BP1~!#B>$O(B0$B$rJV$9!#(B
#include <unistd.h>
int getdtablesize(void)
- $BLa$jCM(B
$B?75,:[email protected]=R;R$N%$%s%G%C%/%9:GBgCM!#(B |
#include <bsys/unixemu.h>
int getlink( const char *path, char *buf )
UNIX$B%(%_%e%l!<%?>e$N%"%W%j%1!<%7%g%s$+$i(B BTRON $B$N$+$iBP1~$9$k
- $B0z?t(B
const char *path | LINK $B$KJQ49$9$k%U%!%$%k(B/$B%G%#%l%/%H%j$N%Q%9(B |
char *buf | LINK $B$r3JG<$9$k%a%b%j!#(Bsizeof( LINK)$B0J>e$NNN0h$,I,MW!#(B |
- $BLa$jCM(B
0 | $B@5>o=*N;!#(B |
-1 | $B%(%i!errno$B$K%(%i!<%3!<%I$r@_Dj$9$k!#(B |
#include <sys/types.h>
#include <sys/stat.h>
int mkfifo(const char *path, mode_t mode)
$B%@%_!o$K%(%i!<=*N;$9$k!#(B
#include <sys/resource.h>
int getrlimit(int which, struct rlimit *rlp)
$B%@%_!o=*N;$9$k!#(B
#include <unistd.h>
int setgid(gid_t gid)
$B%@%_!o$K%(%i!<=*N;$9$k!#(B
#include <unistd.h>
int issetugid(void)
$B%@%_!o$K(B0$B$rJV$9!#(B
#include <unistd.h>
int mknod(const char *path, mode_t mode, dev_t dev)
$B%@%_!o$K%(%i!<=*N;$9$k!#(B
#include <sys/types.h>
#include <sys/stat.h>
int chmod(const char *path, mode_t mode)
int fchmod(int fd, mode_t mode)
$B%@%_!o=*N;$9$k!#(B
#include <unistd.h>
int chown(const char *path, uid_t uid, gid_t gid)
int fchown(int fd, uid_t uid, gid_t gid)
int lchown(const char *path, uid_t uid, gid_t gid)
$B%@%_!o=*N;$9$k!#(B
#include <unistd.h>
int setuid(uid_t uid)
$B%@%_!o$K@5>o=*N;$9$k!#(B
#include <unistd.h>
uid_t getuid(void)
$B%@%_!o$K(B0$B$rJV$9!#(B
#include <unistd.h>
uid_t geteuid(void)
$B%@%_!o$K(B0$B$rJV$9!#(B
#include <sys/stat.h>
int chflags(const char *path, unsigned long flags)
int fchflags(int fd, unsigned long flags)
$B%@%_!o=*N;$9$k!#(B
#include <signal.h>
int kill(pid_t pid, int signum)
$B%@%_!o=*N;$9$k!#(B
#include <unistd.h>
char *sbrk(int incr)
$B%@%_!o$K%(%i!<=*N;$9$k!#(B
#include <sys/types.h>
#include <sys/mman.h>
caddr_t mmap(caddr_t *addr, size_t len, int prot, int flags, int fd, off_t pos)
$B%@%_!o$K%(%i!<=*N;$9$k!#(B
#include <sys/types.h>
#include <sys/mman.h>
int munmap(caddr_t *addr, size_t len)
$B%@%_!o$K%(%i!<=*N;$9$k!#(B
#include <unistd.h>
int getgroups(int gidsetsize, gid_t *gidset)
$B%@%_!o=*N;$9$k!#(B
#include <unistd.h>
pid_t getpgrp(void)
$B%@%_!o$K%(%i!<=*N;$9$k!#(B
#include <unistd.h>
gid_t getegid(void)
$B%@%_!o$K(B0$B$rJV$9!#(B
#include <unistd.h>
gid_t getgid(void)
$B%@%_!o$K(B0$B$rJV$9!#(B
#include <sys/types.h>
#include <sys/stat.h>
mode_t umask(mode_t newmask)
$B%@%_!o=*N;$9$k!#(B
#include <unistd.h>
int fsync(int fd)
$B%@%_!o=*N;$9$k!#(B
#include <signal.h>
int sigsuspend(const sigset_t *mask)
$B%@%_!o=*N;$9$k!#(B
#include <sys/time.h>
int settimeofday(const struct timeval *tv, const struct timezone *tzp)
$B%@%_!o=*N;$9$k!#(B
#include <unistd.h>
int link(const char *path, const char *link)
$B%@%_!
errno
$B$K@_Dj$5$l$k%(%i!<%3!<%I$O0J2<$NDL$j!#(B
#include <errno.h>
ENOENT | $B%U%!%$%k!?%G%#%l%/%H%j$,B8:_$7$J$$(B |
EBADF | $B%U%!%$%k%G%#%9%/%j%W%?$,4V0c$C$F$$$k(B |
EINVAL | $B%Q%i%a!<%?$,IT@5$G$"$k(B |
EIO | I/O $B%(%i!<$,5/$-$?(B |
ENOMEM | $B%a%b%jITB-(B |
EPERM | $BA`:n$,5v2D$5$l$F$$$J$$(B |
EINTR | $B%7%9%F%`%3!<%kCf$K3d$j9~$_$,H/@8$7$?(B |
ENOEXEC | $B |
ECHILD | $B;R%W%m%;%9IT:_%(%i!<(B |
EACCES | $B%Q!<%_%C%7%g%s%(%i!<(B |
EFAULT | $BIT@5%"%I%l%9(B |
EBUSY | $B%G%P%$%9$,;HMQCf(B |
EEXIST | $B%U%!%$%k$,4{$KB8:_$7$F$$$k(B |
EXDEV | $B%G%P%$%94V$N%j%s%/(B |
ENODEV | $B$=$N%G%P%$%9$G$O$=$NA`:n$,%5%]!<%H$5$l$F$$$J$$(B |
ENOTDIR | $B%G%#%l%/%H%j$G$J$$(B |
EISDIR | $B%G%#%l%/%H%j$G$"$k(B |
ENOTTY | $B$=$N%G%P%$%9$K$OITE,@Z$J(Bioctl |
ENOSPC | $B%G%P%$%9%U%k(B |
EROFS | $BFI$_ |
$B$3$N>O$NL\