diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2008-09-11 00:30:32 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2008-09-11 00:30:32 +0000 |
commit | 9ecc83a3f7a3d4c2ee93bf3da38dbd90826fe84c (patch) | |
tree | 0ce07b96221fed01dc899c40727616721b0423ef /libgloss/spu | |
parent | e841b018cbcc123c8415671dd783ba8770b90ce9 (diff) | |
download | newlib-9ecc83a3f7a3d4c2ee93bf3da38dbd90826fe84c.zip newlib-9ecc83a3f7a3d4c2ee93bf3da38dbd90826fe84c.tar.gz newlib-9ecc83a3f7a3d4c2ee93bf3da38dbd90826fe84c.tar.bz2 |
2008-09-10 Ken Werner <ken.werner@de.ibm.com>
* spu/dirfuncs.c: Avoid warnings.
* spu/kill.c: Likewise.
Diffstat (limited to 'libgloss/spu')
-rw-r--r-- | libgloss/spu/dirfuncs.c | 20 | ||||
-rw-r--r-- | libgloss/spu/kill.c | 3 |
2 files changed, 17 insertions, 6 deletions
diff --git a/libgloss/spu/dirfuncs.c b/libgloss/spu/dirfuncs.c index 397a4e9..adf1b0e 100644 --- a/libgloss/spu/dirfuncs.c +++ b/libgloss/spu/dirfuncs.c @@ -56,22 +56,30 @@ typedef struct { unsigned int pad0[3]; } syscall_opendir_t; +typedef struct { + uint64_t dir; + unsigned int pad0[2]; +} syscall_opendir_ret_t; + DIR * opendir (const char *name) { DIR *dir; - int ppc_dir, i; - syscall_opendir_t sys; + int i; + union { + syscall_opendir_t sys; + syscall_opendir_ret_t ret; + } u; - sys.name = (unsigned int) name; + u.sys.name = (unsigned int) name; for (i = 0; i < SPE_OPENDIR_MAX; i++) { if (!spe_dir[i].ppc_dir) { dir = &spe_dir[i]; - __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_OPENDIR, &sys); + __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_OPENDIR, &u); /* * Pull 64 bits out of the result. */ - dir->ppc_dir = ((uint64_t*)&sys)[0]; + dir->ppc_dir = u.ret.dir; if (!dir->ppc_dir) { dir = NULL; } @@ -163,5 +171,5 @@ telldir (DIR *dir) { uint64_t ppc_dir = dir->ppc_dir; - __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_TELLDIR, &ppc_dir); + return __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_TELLDIR, &ppc_dir); } diff --git a/libgloss/spu/kill.c b/libgloss/spu/kill.c index 8a5d22c..1aa2f5e 100644 --- a/libgloss/spu/kill.c +++ b/libgloss/spu/kill.c @@ -31,6 +31,7 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com) */ #include <unistd.h> +#include <errno.h> int kill (int pid, int sig) @@ -39,5 +40,7 @@ kill (int pid, int sig) { _exit (sig); } + errno = ESRCH; + return -1; } |