コード例 #1
0
ファイル: gtcwdlnx.c プロジェクト: Azarien/open-watcom-v2
_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 );
}
コード例 #2
0
ファイル: sockcall.c プロジェクト: ABratovic/open-watcom-v2
long __socketcall( int call, u_long *args )
{
    u_long res = sys_call2( SYS_socketcall, call, (u_long)args );
    __syscall_return( long, res );
}
コード例 #3
0
ファイル: clkset.c プロジェクト: ArmstrongJ/open-watcom-v2
_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 );
}
コード例 #4
0
ファイル: setregid.c プロジェクト: Ukusbobra/open-watcom-v2
_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 );
}
コード例 #5
0
ファイル: fchmod.c プロジェクト: ABratovic/open-watcom-v2
_WCRTLINK int fchmod( int __fd, mode_t __mode )
{
    u_long  res = sys_call2( SYS_fchmod, __fd, __mode );
    __syscall_return( int, res );
}
コード例 #6
0
ファイル: kill.c プロジェクト: ABratovic/open-watcom-v2
_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 );
}
コード例 #7
0
ファイル: ftrunc.c プロジェクト: Ukusbobra/open-watcom-v2
_WCRTLINK int ftruncate( int __fd, off_t __length )
{
    u_long res = sys_call2( SYS_ftruncate, __fd, __length );
    __syscall_return( int, res );
}
コード例 #8
0
ファイル: mmap.c プロジェクト: ArmstrongJ/open-watcom-v2
_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 );
}
コード例 #9
0
ファイル: message.c プロジェクト: orlv/fos
res_t forward(struct message *msg, tid_t to)
{
  return sys_call2(_FOS_FORWARD, (u32_t) msg, to);
}
コード例 #10
0
ファイル: rename.c プロジェクト: ArmstrongJ/open-watcom-v2
_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 );
}
コード例 #11
0
ファイル: setegid.c プロジェクト: ABratovic/open-watcom-v2
_WCRTLINK int setegid( gid_t __newegroup )
{
    u_long  res = sys_call2( SYS_setregid, (u_long)-1, (u_long)__newegroup );
    __syscall_return( int, res );
}
コード例 #12
0
ファイル: chmod.c プロジェクト: ABratovic/open-watcom-v2
_WCRTLINK int chmod( const char *__path, mode_t __mode )
{
    u_long res = sys_call2( SYS_chmod, (u_long)__path, __mode );
    __syscall_return( int, res );
}
コード例 #13
0
ファイル: setrlim.c プロジェクト: ABratovic/open-watcom-v2
_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 );
}
コード例 #14
0
ファイル: fstat.c プロジェクト: ArmstrongJ/open-watcom-v2
_WCRTLINK int fstat( int __fildes, struct stat * __buf )
{
    syscall_res res = sys_call2( SYS_fstat, __fildes, (u_long)__buf );
    __syscall_return( int, res );
}
コード例 #15
0
ファイル: truncate.c プロジェクト: ABratovic/open-watcom-v2
_WCRTLINK int truncate( const char *__path, off_t __length )
{
    u_long res = sys_call2( SYS_truncate, (u_long)__path, __length );
    __syscall_return( int, res );
}
コード例 #16
0
ファイル: setpgid.c プロジェクト: Ukusbobra/open-watcom-v2
_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 );
}
コード例 #17
0
ファイル: getrlim.c プロジェクト: ArmstrongJ/open-watcom-v2
_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 );
}
コード例 #18
0
ファイル: link.c プロジェクト: ArmstrongJ/open-watcom-v2
_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 );
}
コード例 #19
0
ファイル: stat64.c プロジェクト: ArmstrongJ/open-watcom-v2
_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 );
}