Example #1
0
_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 );
}
Example #2
0
long __socketcall( int call, u_long *args )
{
    u_long res = sys_call2( SYS_socketcall, call, (u_long)args );
    __syscall_return( long, res );
}
Example #3
0
_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 );
}
Example #4
0
_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 );
}
Example #5
0
_WCRTLINK int fchmod( int __fd, mode_t __mode )
{
    u_long  res = sys_call2( SYS_fchmod, __fd, __mode );
    __syscall_return( int, res );
}
Example #6
0
_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 );
}
Example #7
0
_WCRTLINK int ftruncate( int __fd, off_t __length )
{
    u_long res = sys_call2( SYS_ftruncate, __fd, __length );
    __syscall_return( int, res );
}
Example #8
0
_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 );
}
Example #9
0
File: message.c Project: orlv/fos
res_t forward(struct message *msg, tid_t to)
{
  return sys_call2(_FOS_FORWARD, (u32_t) msg, to);
}
Example #10
0
_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 );
}
Example #11
0
_WCRTLINK int setegid( gid_t __newegroup )
{
    u_long  res = sys_call2( SYS_setregid, (u_long)-1, (u_long)__newegroup );
    __syscall_return( int, res );
}
Example #12
0
_WCRTLINK int chmod( const char *__path, mode_t __mode )
{
    u_long res = sys_call2( SYS_chmod, (u_long)__path, __mode );
    __syscall_return( int, res );
}
Example #13
0
_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 );
}
Example #14
0
_WCRTLINK int fstat( int __fildes, struct stat * __buf )
{
    syscall_res res = sys_call2( SYS_fstat, __fildes, (u_long)__buf );
    __syscall_return( int, res );
}
Example #15
0
_WCRTLINK int truncate( const char *__path, off_t __length )
{
    u_long res = sys_call2( SYS_truncate, (u_long)__path, __length );
    __syscall_return( int, res );
}
Example #16
0
_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 );
}
Example #17
0
_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 );
}
Example #18
0
_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 );
}
Example #19
0
_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 );
}