Backport main branch improvements (#658)

* Add sys_ prefix to unwrapped system calls
* This change also implements getlogin() and getlogin_r().
* Add getgroups and setgroups (#619)
* Fix getgroups / setgroups tests across platforms. See #619
* Change accept type to struct sockaddr * (#630)
* vista: use old strace path
This commit is contained in:
Gavin Hayes 2022-10-10 23:44:29 -04:00 committed by GitHub
parent 4381b3d925
commit f4ff1729d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
831 changed files with 1381 additions and 1822 deletions

View file

@ -20,10 +20,10 @@
#include "libc/fmt/conv.h"
#include "libc/intrin/kprintf.h"
#include "libc/log/check.h"
#include "libc/stdio/rand.h"
#include "libc/runtime/runtime.h"
#include "libc/sock/sock.h"
#include "libc/sock/struct/sockaddr.h"
#include "libc/stdio/rand.h"
#include "libc/str/str.h"
#include "libc/sysv/consts/af.h"
#include "libc/sysv/consts/ipproto.h"
@ -89,7 +89,8 @@ void TcpServer(void) {
ip, ntohs(addr2.sin_port));
for (;;) {
addrsize2 = sizeof(struct sockaddr_in);
CHECK_NE(-1, (client = accept(sock, &addr2, &addrsize2)));
CHECK_NE(-1,
(client = accept(sock, (struct sockaddr *)&addr2, &addrsize2)));
ip = ntohl(addr2.sin_addr.s_addr);
kprintf("got client %hhu.%hhu.%hhu.%hhu %hu%n", ip >> 24, ip >> 16, ip >> 8,
ip, ntohs(addr2.sin_port));

View file

@ -1410,7 +1410,7 @@ static void OnExit(void) {
static void MakeLatencyLittleLessBad(void) {
_peekall();
LOGIFNEG1(mlockall(MCL_CURRENT));
LOGIFNEG1(sys_mlockall(MCL_CURRENT));
LOGIFNEG1(nice(-5));
}