SYSCALLS.CPP File Reference

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

EXPORT_C int _open_r ( struct _reent * r,
const char * name,
int mode,
int perms
)

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,
int mode,
int perms
)

A reentrant version of wopen() .

Parameters

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

read(int, char *, size_t)

EXPORT_C int read ( int fd,
char * buf,
size_t cnt
)

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,
int fd,
char * buf,
size_t nbyte
)

A reentrant version of read() .

Parameters

struct _reent * r
int fd
char * buf
size_t nbyte

write(int, const char *, size_t)

EXPORT_C int write ( int fd,
const char * buf,
size_t cnt
)

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,
int fd,
const char * buf,
size_t nbyte
)

A reentrant version of write() .

Parameters

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

close(int)

EXPORT_C int close ( int fd )

Close a file.

Parameters

int fd

_close_r(struct _reent *, int)

EXPORT_C int _close_r ( struct _reent * r,
int fd
)

A reentrant version of close() .

Parameters

struct _reent * r
int fd

fsync(int)

EXPORT_C int fsync ( int fd )

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

Parameters

int fd Is the file descriptor for the file to be synchronized.

_fsync_r(struct _reent *, int)

EXPORT_C int _fsync_r ( struct _reent * r,
int fd
)

A reentrant version of fsync() .

Parameters

struct _reent * r
int fd

lseek(int, off_t, int)

EXPORT_C off_t lseek ( int fd,
off_t pos,
int whence
)

Repositions the read/write file offset.

Parameters

int fd Is the file descriptor of an open file.
off_t pos Specifies the number of bytes to offset the file pointer from a specified file origin.
int whence Specifies the location from which to start seeking.

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

EXPORT_C off_t _lseek_r ( struct _reent * r,
int fd,
off_t pos,
int whence
)

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,
int fd,
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 int dup ( int aFid )

Duplicates an open file descriptor.

Parameters

int aFid Is the file descriptor to duplicate.

_dup_r(struct _reent *, int)

EXPORT_C int _dup_r ( struct _reent * r,
int aFid
)

A reentrant version of dup() .

Parameters

struct _reent * r
int aFid

dup2(int, int)

EXPORT_C int dup2 ( int aFid1,
int aFid2
)

Function duplicates an open file descriptor.

Parameters

int aFid1 Is the file descriptor to duplicate.
int aFid2 Is the file descriptor that filedes is duplicated onto.

_dup2_r(struct _reent *, int, int)

EXPORT_C int _dup2_r ( struct _reent * r,
int aFid1,
int aFid2
)

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,
int aFid,
int aCmd,
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 * _buf Points to the buffer to copy the current working directory to, or NULL if getcwd() should allocate the buffer.
size_t _size Is 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 int chdir ( 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 * _path Is 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 int wchdir ( 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 int rmdir ( 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 * _path Points 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 int wrmdir ( 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 int unlink ( 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 * _path Points 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 int wunlink ( 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 int rename ( const char * oldpath,
const char * newpath
)

Renames a file.

Parameters

const char * oldpath Points 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 * newpath Points 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 int wrename ( 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 int waitpid ( int pid,
int * status,
int options
)

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 pid Specifies a set of child processes for which the status is requested
int * status Specifies the location to which the child process' exit status is stored.
int options Is 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,
int pid,
int * status,
int options
)

A reentrant version of waitpid() .

Parameters

struct _reent * r
int pid
int * status
int options

wait(int *)

EXPORT_C int wait ( 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 int system ( const char * cmd )

Execute command.

Parameters

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

wsystem(const wchar_t *)

EXPORT_C int wsystem ( const wchar_t * cmd )

A wide-character version of a system() .

Parameters

const wchar_t * cmd