Skip to content

Commit e9b2789

Browse files
committed
Remove unused syscall and fix for getrandom.
1 parent 54c6cd0 commit e9b2789

File tree

2 files changed

+8
-25
lines changed

2 files changed

+8
-25
lines changed

src/missing_syscall.h

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,9 @@
2222

2323
/* Missing glibc definitions to access certain kernel APIs */
2424

25-
#if !HAVE_DECL_PIVOT_ROOT
26-
static inline int pivot_root(const char *new_root, const char *put_old) {
27-
return syscall(SYS_pivot_root, new_root, put_old);
28-
}
29-
#endif
30-
3125
/* ======================================================================= */
3226

33-
#if !HAVE_DECL_GETRANDOM
27+
#if !HAVE_GETRANDOM
3428
# ifndef __NR_getrandom
3529
# if defined __x86_64__
3630
# define __NR_getrandom 318
@@ -75,26 +69,9 @@ static inline int getrandom(void *buffer, size_t count, unsigned flags) {
7569

7670
/* ======================================================================= */
7771

78-
#if !HAVE_DECL_GETTID
72+
#if !HAVE_GETTID
7973
static inline pid_t gettid(void) {
8074
return (pid_t) syscall(SYS_gettid);
8175
}
8276
#endif
8377

84-
/* ======================================================================= */
85-
86-
#if !HAVE_DECL_NAME_TO_HANDLE_AT
87-
# ifndef __NR_name_to_handle_at
88-
# if defined(__x86_64__)
89-
# define __NR_name_to_handle_at 303
90-
# elif defined(__i386__)
91-
# define __NR_name_to_handle_at 341
92-
# elif defined(__arm__)
93-
# define __NR_name_to_handle_at 370
94-
# elif defined(__powerpc__)
95-
# define __NR_name_to_handle_at 345
96-
# else
97-
# error "__NR_name_to_handle_at is not defined"
98-
# endif
99-
# endif
100-
#endif

src/random-util.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@
3030
#include <sys/auxv.h>
3131
#endif
3232

33+
#if USE_SYS_RANDOM_H
34+
# include <sys/random.h>
35+
#else
36+
# include <linux/random.h>
37+
#endif
38+
3339
#include "fd-util.h"
3440
#include "io-util.h"
3541
#include "missing.h"

0 commit comments

Comments
 (0)