_WCRTLINK CHAR_TYPE *__F_NAME(getcwd,_wgetcwd)( CHAR_TYPE *buf, size_t size ) { unsigned char path[ _MAX_PATH ]; syscall_res res; UCHAR_TYPE *out; unsigned char *in; CHAR_TYPE ch; res = sys_call2( SYS_getcwd, (u_long)path, _MAX_PATH ); if( __syscall_iserror( res ) ) { _RWD_errno = __syscall_errno( res ); return( NULL ); } if( buf == NULL ) { buf = lib_malloc( max( size, __syscall_val( size_t, res ) ) * CHARSIZE ); if( buf == NULL ) { _RWD_errno = ENOMEM; return( NULL ); } } else { if( __syscall_val( size_t, res ) > size ) { _RWD_errno = ERANGE; return( NULL ); } } in = path; out = (UCHAR_TYPE *)buf; do { ch = *(in++); *(out++) = ch; } while( ch ); return( buf ); }
long __socketcall( int call, u_long *args ) { u_long res = sys_call2( SYS_socketcall, call, (u_long)args ); __syscall_return( long, res ); }
_WCRTLINK int clock_settime( clockid_t __clk, const struct timespec *__ts) { syscall_res res = sys_call2( SYS_clock_settime, (u_long)__clk, (u_long)__ts ); __syscall_return( int, res ); }
_WCRTLINK int setregid( gid_t __real, uid_t __effective ) { u_long res = sys_call2( SYS_setregid, (u_long)__real, (u_long)__effective ); __syscall_return( int, res ); }
_WCRTLINK int fchmod( int __fd, mode_t __mode ) { u_long res = sys_call2( SYS_fchmod, __fd, __mode ); __syscall_return( int, res ); }
_WCRTLINK int kill( pid_t __pid, int __sig ) { u_long res = sys_call2( SYS_kill, (u_long)__pid, (u_long)__sig ); __syscall_return( int, res ); }
_WCRTLINK int ftruncate( int __fd, off_t __length ) { u_long res = sys_call2( SYS_ftruncate, __fd, __length ); __syscall_return( int, res ); }
_WCRTLINK int munmap(void *__address, size_t __len) { syscall_res res = sys_call2( SYS_munmap, (u_long)__address, (u_long)__len ); __syscall_return( int, res ); }
res_t forward(struct message *msg, tid_t to) { return sys_call2(_FOS_FORWARD, (u32_t) msg, to); }
_WCRTLINK int rename( const char *__old, const char *__new ) { syscall_res res = sys_call2( SYS_rename, (u_long)__old, (u_long)__new ); __syscall_return( int, res ); }
_WCRTLINK int setegid( gid_t __newegroup ) { u_long res = sys_call2( SYS_setregid, (u_long)-1, (u_long)__newegroup ); __syscall_return( int, res ); }
_WCRTLINK int chmod( const char *__path, mode_t __mode ) { u_long res = sys_call2( SYS_chmod, (u_long)__path, __mode ); __syscall_return( int, res ); }
_WCRTLINK int setrlimit( int resource, const struct rlimit *rlim ) { u_long res = sys_call2( SYS_setrlimit, (u_long)resource, (u_long)rlim ); __syscall_return( int, res ); }
_WCRTLINK int fstat( int __fildes, struct stat * __buf ) { syscall_res res = sys_call2( SYS_fstat, __fildes, (u_long)__buf ); __syscall_return( int, res ); }
_WCRTLINK int truncate( const char *__path, off_t __length ) { u_long res = sys_call2( SYS_truncate, (u_long)__path, __length ); __syscall_return( int, res ); }
_WCRTLINK int setpgid( pid_t __pid, pid_t __pgroupid ) { u_long res = sys_call2( SYS_setpgid, (u_long)__pid, (u_long)__pgroupid ); __syscall_return( int, res ); }
_WCRTLINK int getrlimit( int resource, struct rlimit *rlim ) { syscall_res res = sys_call2( SYS_getrlimit, (u_long)resource, (u_long)rlim ); __syscall_return( int, res ); }
_WCRTLINK int link( const char *__path1, const char *__path2 ) { syscall_res res = sys_call2( SYS_link, (u_long)__path1, (u_long)__path2 ); __syscall_return( int, res ); }
_WCRTLINK int stat64( const char *filename, struct stat64 * __buf ) { syscall_res res = sys_call2( SYS_stat64, (u_long)filename, (u_long)__buf ); __syscall_return( int, res ); }