1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 05:31:22 +00:00
nixpkgs/pkgs/development/libraries/skalibs/getpeereid.patch
Patrick Mahoney f0478220d8 skalibs: new package
Skalibs is a set of general-purpose C programming libraries used for
building all software at skarnet.org.
2014-08-22 23:22:55 -05:00

29 lines
595 B
Diff

--- a/src/libstddjb/getpeereid.h
+++ b/src/libstddjb/getpeereid.h
@@ -3,6 +3,14 @@
#ifndef GETPEEREID_H
#define GETPEEREID_H
+#include "sysdeps.h"
+
+#ifdef HASGETPEEREID
+/* syscall exists - do nothing */
+
+#else
+
extern int getpeereid (int, int *, int *) ;
#endif
+#endif
--- a/src/libstddjb/ipc_eid.c
+++ b/src/libstddjb/ipc_eid.c
@@ -5,7 +5,7 @@
int ipc_eid (int s, unsigned int *u, unsigned int *g)
{
- int dummyu, dummyg ;
+ unsigned int dummyu, dummyg ;
if (getpeereid(s, &dummyu, &dummyg) < 0) return -1 ;
*u = (unsigned int)dummyu ;
*g = (unsigned int)dummyg ;