SYSCALLS.CPP File Reference

_open_r(struct _reent *, const char *, int, int)

EXPORT_C int_open_r(struct _reent *r,
const char *name,
intmode,
intperms
)

A reentrant version of open().

Parameters

struct _reent * r
const char * name
int mode
int perms

_wopen_r(struct _reent *, const wchar_t *, int, int)

EXPORT_C int_wopen_r(struct _reent *r,
const wchar_t *name,
intmode,
intperms
)

A reentrant version of wopen().

Parameters

struct _reent * r
const wchar_t * name
int mode
int perms

read(int, char *, size_t)

EXPORT_C intread(intfd,
char *buf,
size_tcnt
)

Reads a block of data of the length specified by cnt.

Parameters

int fd
char * buf
size_t cnt

_read_r(struct _reent *, int, char *, size_t)

EXPORT_C int_read_r(struct _reent *r,
intfd,
char *buf,
size_tnbyte
)

A reentrant version of read().

Parameters

struct _reent * r
int fd
char * buf
size_t nbyte

write(int, const char *, size_t)

EXPORT_C intwrite(intfd,
const char *buf,
size_tcnt
)

Writes a block of data of the length specified by cnt.

Parameters

int fd
const char * buf
size_t cnt

_write_r(struct _reent *, int, const char *, size_t)

EXPORT_C int_write_r(struct _reent *r,
intfd,
const char *buf,
size_tnbyte
)

A reentrant version of write().

Parameters

struct _reent * r
int fd
const char * buf
size_t nbyte

close(int)

EXPORT_C intclose(intfd)

Close a file.

Parameters

int fd

_close_r(struct _reent *, int)

EXPORT_C int_close_r(struct _reent *r,
intfd
)

A reentrant version of close().

Parameters

struct _reent * r
int fd

fsync(int)

EXPORT_C intfsync(intfd)

Synchronizes a file's in-memory state with that on the physical medium.

Parameters

int fdIs the file descriptor for the file to be synchronized.

_fsync_r(struct _reent *, int)

EXPORT_C int_fsync_r(struct _reent *r,
intfd
)

A reentrant version of fsync().

Parameters

struct _reent * r
int fd

lseek(int, off_t, int)

EXPORT_C off_tlseek(intfd,
off_tpos,
intwhence
)

Repositions the read/write file offset.

Parameters

int fdIs the file descriptor of an open file.
off_t posSpecifies the number of bytes to offset the file pointer from a specified file origin.
int whenceSpecifies the location from which to start seeking.

_lseek_r(struct _reent *, int, off_t, int)

EXPORT_C off_t_lseek_r(struct _reent *r,
intfd,
off_tpos,
intwhence
)

A reentrant version of fseek().

Parameters

struct _reent * r
int fd
off_t pos
int whence

_fstat_r(struct _reent *, int, struct stat *)

EXPORT_C int_fstat_r(struct _reent *r,
intfd,
struct stat *st
)

A reentrant version of fstat().

Parameters

struct _reent * r
int fd
struct stat * st

_stat_r(struct _reent *, const char *, struct stat *)

EXPORT_C int_stat_r(struct _reent *r,
const char *name,
struct stat *st
)

A reentrant version of stat().

Parameters

struct _reent * r
const char * name
struct stat * st

_wstat_r(struct _reent *, const wchar_t *, struct stat *)

EXPORT_C int_wstat_r(struct _reent *r,
const wchar_t *name,
struct stat *st
)

A reentrant version of wstat().

Parameters

struct _reent * r
const wchar_t * name
struct stat * st

dup(int)

EXPORT_C intdup(intaFid)

Duplicates an open file descriptor.

Parameters

int aFidIs the file descriptor to duplicate.

_dup_r(struct _reent *, int)

EXPORT_C int_dup_r(struct _reent *r,
intaFid
)

A reentrant version of dup().

Parameters

struct _reent * r
int aFid

dup2(int, int)

EXPORT_C intdup2(intaFid1,
intaFid2
)

Function duplicates an open file descriptor.

Parameters

int aFid1Is the file descriptor to duplicate.
int aFid2Is the file descriptor that filedes is duplicated onto.

_dup2_r(struct _reent *, int, int)

EXPORT_C int_dup2_r(struct _reent *r,
intaFid1,
intaFid2
)

A reentrant version of dup2().

Parameters

struct _reent * r
int aFid1
int aFid2

_ioctl_r(struct _reent *, int, int, void *)

EXPORT_C int_ioctl_r(struct _reent *r,
intaFid,
intaCmd,
void *aParam
)

A reentrant version of ioctl().

Parameters

struct _reent * r
int aFid
int aCmd
void * aParam

getcwd(char *, size_t)

EXPORT_C char *getcwd(char *_buf,
size_t_size
)

Gets the path name of the current working directory. If a buffer is specified, the path name is placed in that buffer, and the address of the buffer is returned.

Parameters

char * _bufPoints to the buffer to copy the current working directory to, or NULL if getcwd() should allocate the buffer.
size_t _sizeIs the size, in bytes, of the array of characters that buf points to.

wgetcwd(wchar_t *, size_t)

EXPORT_C wchar_t *wgetcwd(wchar_t *_buf,
size_t_size
)

A wide_character version of a getcwd().

Parameters

wchar_t * _buf
size_t _size

_getcwd_r(struct _reent *, char *, size_t)

EXPORT_C char *_getcwd_r(struct _reent *r,
char *_buf,
size_t_size
)

A reentrant version of getcwd().

Parameters

struct _reent * r
char * _buf
size_t _size

_wgetcwd_r(struct _reent *, wchar_t *, size_t)

EXPORT_C wchar_t *_wgetcwd_r(struct _reent *r,
wchar_t *_buf,
size_t_size
)

A wide-character version of reentrant of getcwd().

Parameters

struct _reent * r
wchar_t * _buf
size_t _size

chdir(const char *)

EXPORT_C intchdir(const char *_path)

Changes the current working directory to be pathname. The current directory is the beginning point for file searches when path names are not absolute. If the chdir() function fails, the current working directory remains unchanged.

Parameters

const char * _pathIs the path name of a directory.

_chdir_r(struct _reent *, const char *)

EXPORT_C int_chdir_r(struct _reent *r,
const char *_path
)

A reentrant version of chdir().

Parameters

struct _reent * r
const char * _path

wchdir(const wchar_t *)

EXPORT_C intwchdir(const wchar_t *_path)

A wide-character version of chdir().

Parameters

const wchar_t * _path

_wchdir_r(struct _reent *, const wchar_t *)

EXPORT_C int_wchdir_r(struct _reent *r,
const wchar_t *_path
)

A reentrant version of wchdir().

Parameters

struct _reent * r
const wchar_t * _path

rmdir(const char *)

EXPORT_C intrmdir(const char *_path)

Removes an empty directory whose name is given by pathname. The directory must not have any entries other than dot (.) and dot-dot (..).

Parameters

const char * _pathPoints to the directory that the rmdir() function removes.

_rmdir_r(struct _reent *, const char *)

EXPORT_C int_rmdir_r(struct _reent *r,
const char *_path
)

A reentrant version of rmdir().

Parameters

struct _reent * r
const char * _path

wrmdir(const wchar_t *)

EXPORT_C intwrmdir(const wchar_t *_path)

A wide-character version of rmdir().

Parameters

const wchar_t * _path

_wrmdir_r(struct _reent *, const wchar_t *)

EXPORT_C int_wrmdir_r(struct _reent *r,
const wchar_t *_path
)

A reentrant version of wrmdir().

Parameters

struct _reent * r
const wchar_t * _path

_mkdir_r(struct _reent *, const char *, mode_t)

EXPORT_C int_mkdir_r(struct _reent *r,
const char *_path,
mode_t_mode
)

A reentrant version of mkdir().

Parameters

struct _reent * r
const char * _path
mode_t _mode

_wmkdir_r(struct _reent *, const wchar_t *, mode_t)

EXPORT_C int_wmkdir_r(struct _reent *r,
const wchar_t *_path,
mode_t_mode
)

A reentrant version of wmkdir().

Parameters

struct _reent * r
const wchar_t * _path
mode_t _mode

_chmod_r(struct _reent *, const char *, mode_t)

EXPORT_C int_chmod_r(struct _reent *r,
const char *_path,
mode_t_mode
)

A reentrant version of chmod().

Parameters

struct _reent * r
const char * _path
mode_t _mode

_wchmod_r(struct _reent *, const wchar_t *, mode_t)

EXPORT_C int_wchmod_r(struct _reent *r,
const wchar_t *_path,
mode_t_mode
)

A reentrant version of wchmod().

Parameters

struct _reent * r
const wchar_t * _path
mode_t _mode

unlink(const char *)

EXPORT_C intunlink(const char *_path)

Removes a link to a file, and decrements the link count of the referenced file by one. When the file's link count becomes 0 and no process has the file open, the space occupied by the file is freed, and the file is no longer accessible. If one or more processes have the file open when the last link is removed, the link is removed before unlink() returns, but the removal of the file contents is postponed until all references to the file are closed.

Parameters

const char * _pathPoints to the path name that names the file to be unlinked.

_unlink_r(struct _reent *, const char *)

EXPORT_C int_unlink_r(struct _reent *r,
const char *_path
)

A reentrant version of unlink().

Parameters

struct _reent * r
const char * _path

wunlink(const wchar_t *)

EXPORT_C intwunlink(const wchar_t *_path)

A wide-character version of unlink().

Parameters

const wchar_t * _path

_wunlink_r(struct _reent *, const wchar_t *)

EXPORT_C int_wunlink_r(struct _reent *r,
const wchar_t *_path
)

A wide-character version of reentrant of unlink().

Parameters

struct _reent * r
const wchar_t * _path

rename(const char *, const char *)

EXPORT_C intrename(const char *oldpath,
const char *newpath
)

Renames a file.

Parameters

const char * oldpathPoints to the path name of the file to be renamed. The path name can be absolute or relative. If a relative path name is given, the file is searched from the current working directory.
const char * newpathPoints to the path name of the file. The path name can be absolute or relative. If a relative path name is given, the file is searched from the current working directory.

_rename_r(struct _reent *, const char *, const char *)

EXPORT_C int_rename_r(struct _reent *r,
const char *oldpath,
const char *newpath
)

A reentrant version of rename().

Parameters

struct _reent * r
const char * oldpath
const char * newpath

wrename(const wchar_t *, const wchar_t *)

EXPORT_C intwrename(const wchar_t *oldpath,
const wchar_t *newpath
)

A wide-character version of rename().

Parameters

const wchar_t * oldpath
const wchar_t * newpath

_wrename_r(struct _reent *, const wchar_t *, const wchar_t *)

EXPORT_C int_wrename_r(struct _reent *r,
const wchar_t *oldpath,
const wchar_t *newpath
)

A wide-character version of reentrant of rename().

Parameters

struct _reent * r
const wchar_t * oldpath
const wchar_t * newpath

_wrealpath_r(struct _reent *, const wchar_t *, wchar_t *)

EXPORT_C wchar_t *_wrealpath_r(struct _reent *r,
const wchar_t *relpath,
wchar_t *resolved
)

A wide-character version of reentrant of realpath().

Parameters

struct _reent * r
const wchar_t * relpath
wchar_t * resolved

_realpath_r(struct _reent *, const char *, char *)

EXPORT_C char *_realpath_r(struct _reent *r,
const char *relpath,
char *resolved
)

A reentrant version of realpath().

Parameters

struct _reent * r
const char * relpath
char * resolved

waitpid(int, int *, int)

EXPORT_C intwaitpid(intpid,
int *status,
intoptions
)

Lets the calling process obtain status information about one of its child processes. If status information is available for two or more child processes, the order in which their status is reported is unspecified.

Parameters

int pidSpecifies a set of child processes for which the status is requested
int * statusSpecifies the location to which the child process' exit status is stored.
int optionsIs the bitwise inclusive-OR of zero or more of the following flags.

_waitpid_r(struct _reent *, int, int *, int)

EXPORT_C int_waitpid_r(struct _reent *r,
intpid,
int *status,
intoptions
)

A reentrant version of waitpid().

Parameters

struct _reent * r
int pid
int * status
int options

wait(int *)

EXPORT_C intwait(int *status)

Calls reentrant version of waitpid().

Parameters

int * status

_wait_r(struct _reent *, int *)

EXPORT_C int_wait_r(struct _reent *r,
int *status
)

A reentrant version of wait().

Parameters

struct _reent * r
int * status

system(const char *)

EXPORT_C intsystem(const char *cmd)

Execute command.

Parameters

const char * cmdNull-terminated string containing the system command to be executed.

wsystem(const wchar_t *)

EXPORT_C intwsystem(const wchar_t *cmd)

A wide-character version of a system().

Parameters

const wchar_t * cmd