mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-13 22:49:11 +00:00
Perform minor fixups
One of those fixups is making sure that AF_LOCAL is equal to AF_UNIX on the New Technology. See #122
This commit is contained in:
parent
83d0c3b870
commit
807706a099
14 changed files with 76 additions and 134 deletions
|
@ -64,9 +64,6 @@ COSMOPOLITAN_C_START_
|
|||
|
||||
typedef int sig_atomic_t;
|
||||
|
||||
extern const struct sigset kSigsetFull;
|
||||
extern const struct sigset kSigsetEmpty;
|
||||
|
||||
DIR *fdopendir(int) nodiscard;
|
||||
DIR *opendir(const char *) nodiscard;
|
||||
bool fileexists(const char *);
|
||||
|
|
|
@ -64,10 +64,6 @@ o/$(MODE)/libc/calls/raise.o: \
|
|||
OVERRIDE_COPTS += \
|
||||
$(NO_MAGIC)
|
||||
|
||||
o/$(MODE)/libc/calls/siggy.o: \
|
||||
OVERRIDE_COPTS += \
|
||||
-ffunction-sections
|
||||
|
||||
o/$(MODE)/libc/calls/sigenter-freebsd.o \
|
||||
o/$(MODE)/libc/calls/sigenter-netbsd.o \
|
||||
o/$(MODE)/libc/calls/sigenter-openbsd.o \
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/sysv/consts/at.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
|
||||
/**
|
||||
* Changes owner and/or group of pathname.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│
|
||||
│vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi│
|
||||
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
|
||||
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
|
||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||
│ Copyright 2020 Justine Alexandra Roberts Tunney │
|
||||
│ Copyright 2021 Justine Alexandra Roberts Tunney │
|
||||
│ │
|
||||
│ Permission to use, copy, modify, and/or distribute this software for │
|
||||
│ any purpose with or without fee is hereby granted, provided that the │
|
||||
|
@ -16,19 +16,11 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.internal.h"
|
||||
.source __FILE__
|
||||
#include "libc/calls/calls.h"
|
||||
|
||||
// Sets effective user ID.
|
||||
//
|
||||
// @param %edi is user id
|
||||
// @see setuid(), getauxval(AT_SECURE)
|
||||
seteuid:push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov %edi,%esi
|
||||
mov $-1,%edi
|
||||
call setreuid
|
||||
pop %rbp
|
||||
ret
|
||||
.endfn seteuid,globl
|
||||
/**
|
||||
* Sets effective group ID.
|
||||
*/
|
||||
int setegid(unsigned gid) {
|
||||
return setregid(-1, gid);
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│
|
||||
│vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi│
|
||||
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
|
||||
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
|
||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||
│ Copyright 2020 Justine Alexandra Roberts Tunney │
|
||||
│ Copyright 2021 Justine Alexandra Roberts Tunney │
|
||||
│ │
|
||||
│ Permission to use, copy, modify, and/or distribute this software for │
|
||||
│ any purpose with or without fee is hereby granted, provided that the │
|
||||
|
@ -16,19 +16,11 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.internal.h"
|
||||
.source __FILE__
|
||||
#include "libc/calls/calls.h"
|
||||
|
||||
// Sets effective group ID.
|
||||
//
|
||||
// @param %edi is group id
|
||||
// @see setgid(), getauxval(AT_SECURE)
|
||||
setegid:push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov %edi,%esi
|
||||
mov $-1,%edi
|
||||
call setregid
|
||||
pop %rbp
|
||||
ret
|
||||
.endfn setegid,globl
|
||||
/**
|
||||
* Sets effective user ID.
|
||||
*/
|
||||
int seteuid(unsigned euid) {
|
||||
return setreuid(-1, euid);
|
||||
}
|
|
@ -26,9 +26,10 @@
|
|||
/**
|
||||
* Changes program signal blocking state, e.g.:
|
||||
*
|
||||
* sigset_t oldmask;
|
||||
* sigprocmask(SIG_BLOCK, &kSigsetFull, &oldmask);
|
||||
* sigprocmask(SIG_SETMASK, &oldmask, NULL);
|
||||
* sigset_t neu,old;
|
||||
* sigfillset(&neu);
|
||||
* sigprocmask(SIG_BLOCK, &neu, &old);
|
||||
* sigprocmask(SIG_SETMASK, &old, NULL);
|
||||
*
|
||||
* @param how can be SIG_BLOCK (U), SIG_UNBLOCK (/), SIG_SETMASK (=)
|
||||
* @param set is the new mask content (optional)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue