mescc: Support gcc-3.2: Implement getuid, getgid.

* lib/linux+gnu.c (getuid, getdid): New function.
* lib/binutils.c (getuid, getdid): Remove stub.
This commit is contained in:
Jan Nieuwenhuizen 2018-06-07 07:19:01 +02:00
parent d1e3a786aa
commit b7c35dad69
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
4 changed files with 23 additions and 22 deletions

View file

@ -91,20 +91,6 @@ frexp (int x)
return 0;
}
int
getgid (int x)
{
eputs ("getgid stub\n");
return 0;
}
int
getuid (int x)
{
eputs ("getuid stub\n");
return 0;
}
void
perror (char const *message)
{

View file

@ -20,16 +20,19 @@
#define SYS_link 0x09
#define SYS_getpid 0x14
#define SYS_getuid 0x18
#define SYS_kill 0x25
#define SYS_rename 0x26
#define SYS_mkdir 0x27
#define SYS_dup 0x29
#define SYS_pipe 0x2a
#define SYS_getgid 0x2f
#define SYS_signal 0x30
#define SYS_lstat 0x6b
#define SYS_fstat 0x6c
#define SYS_nanosleep 0xa2
int
link (char const *old_name, char const *new_name)
{
@ -42,6 +45,12 @@ getpid ()
return _sys_call (SYS_getpid);
}
uid_t
getuid ()
{
return _sys_call (SYS_getuid);
}
int
kill (pid_t pid, int signum)
{
@ -66,6 +75,12 @@ dup (int old)
return _sys_call1 (SYS_dup, (int)old);
}
gid_t
getgid ()
{
return _sys_call (SYS_getgid);
}
#if __MESC__
void *
signal (int signum, void * action)

View file

@ -36,7 +36,7 @@ _sys_call (int sys_call)
if (r < 0)
errno = -r;
else
errno = 0
errno = 0;
return r;
#endif
}
@ -58,7 +58,7 @@ _sys_call1 (int sys_call, int one)
if (r < 0)
errno = -r;
else
errno = 0
errno = 0;
return r;
#endif
}
@ -81,7 +81,7 @@ _sys_call2 (int sys_call, int one, int two)
if (r < 0)
errno = -r;
else
errno = 0
errno = 0;
return r;
#endif
}
@ -105,7 +105,7 @@ _sys_call3 (int sys_call, int one, int two, int three)
if (r < 0)
errno = -r;
else
errno = 0
errno = 0;
return r;
#endif
}

View file

@ -61,7 +61,7 @@ _sys_call (int sys_call)
if (r < 0)
errno = -r;
else
errno = 0
errno = 0;
return r;
}
@ -72,7 +72,7 @@ _sys_call1 (int sys_call, int one)
if (r < 0)
errno = -r;
else
errno = 0
errno = 0;
return r;
}
@ -83,7 +83,7 @@ _sys_call2 (int sys_call, int one, int two)
if (r < 0)
errno = -r;
else
errno = 0
errno = 0;
return r;
}
@ -94,6 +94,6 @@ _sys_call3 (int sys_call, int one, int two, int three)
if (r < 0)
errno = -r;
else
errno = 0
errno = 0;
return r;
}