mirror of
https://git.musl-libc.org/git/musl
synced 2025-01-09 00:02:17 +03:00
cleanup various minor issues reported by nsz
the changes to syscall_ret are mostly no-ops in the generated code, just cleanup of type issues and removal of some implementation-defined behavior. the one exception is the change in the comparison value, which is fixed so that 0xf...f000 (which in principle could be a valid return value for mmap, although probably never in reality) is not treated as an error return.
This commit is contained in:
parent
729d6368bd
commit
fd142e5ec4
@ -4,7 +4,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
long __syscall_ret(long);
|
long __syscall_ret(unsigned long);
|
||||||
long __syscall(long, ...);
|
long __syscall(long, ...);
|
||||||
long syscall(long, ...);
|
long syscall(long, ...);
|
||||||
|
|
||||||
|
@ -85,7 +85,6 @@ int clock_settime (clockid_t, const struct timespec *);
|
|||||||
int clock_nanosleep (clockid_t, int, const struct timespec *, struct timespec *);
|
int clock_nanosleep (clockid_t, int, const struct timespec *, struct timespec *);
|
||||||
int clock_getcpuclockid (pid_t, clockid_t *);
|
int clock_getcpuclockid (pid_t, clockid_t *);
|
||||||
|
|
||||||
/* FIXME..?? */
|
|
||||||
struct sigevent;
|
struct sigevent;
|
||||||
int timer_create (clockid_t, struct sigevent *, timer_t *);
|
int timer_create (clockid_t, struct sigevent *, timer_t *);
|
||||||
int timer_delete (timer_t);
|
int timer_delete (timer_t);
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
long __syscall_ret(unsigned long r)
|
long __syscall_ret(unsigned long r)
|
||||||
{
|
{
|
||||||
if (r >= (unsigned long)-1 - 4096) {
|
if (r > -4096UL) {
|
||||||
errno = -(long)r;
|
errno = -r;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return (long)r;
|
return r;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include <stddef.h>
|
#include <stdint.h>
|
||||||
#include "syscall.h"
|
#include "syscall.h"
|
||||||
|
|
||||||
void *sbrk(ptrdiff_t inc)
|
void *sbrk(intptr_t inc)
|
||||||
{
|
{
|
||||||
unsigned long cur = syscall(SYS_brk, 0);
|
unsigned long cur = syscall(SYS_brk, 0);
|
||||||
if (inc && syscall(SYS_brk, cur+inc) != cur+inc) return (void *)-1;
|
if (inc && syscall(SYS_brk, cur+inc) != cur+inc) return (void *)-1;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <langinfo.h>
|
#include <langinfo.h>
|
||||||
|
#include "atomic.h"
|
||||||
|
|
||||||
const char *__langinfo(nl_item);
|
const char *__langinfo(nl_item);
|
||||||
|
|
||||||
@ -21,7 +22,7 @@ char *__asctime(const struct tm *tm, char *buf)
|
|||||||
* application developers that they may not be so lucky
|
* application developers that they may not be so lucky
|
||||||
* on other implementations (e.g. stack smashing..).
|
* on other implementations (e.g. stack smashing..).
|
||||||
*/
|
*/
|
||||||
*(volatile int*)0 = 0;
|
a_crash();
|
||||||
}
|
}
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include "syscall.h"
|
#include "syscall.h"
|
||||||
|
|
||||||
pid_t setpgid(pid_t pid, pid_t pgid)
|
int setpgid(pid_t pid, pid_t pgid)
|
||||||
{
|
{
|
||||||
return syscall(SYS_setpgid, pid, pgid);
|
return syscall(SYS_setpgid, pid, pgid);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user