summaryrefslogtreecommitdiff
path: root/getsid.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2014-08-18 04:01:05 -0400
committerEric S. Raymond <esr@thyrsus.com>2014-08-18 04:01:05 -0400
commitcaf45e635c8a3f2446a19b77e7842030ec10d2de (patch)
tree409928dd76f6f96c9ef2e20e95c5b522e5b511c1 /getsid.c
parent117b8c2fcc577ec6eb1730fb554c91ab081f2cf5 (diff)
downloadgpsd-caf45e635c8a3f2446a19b77e7842030ec10d2de.tar.gz
First part of Android port patches: deal with in_port_t. SUN_LEN, and getsid().
Also, fix how configuratuin in libgps_shm.c and smexport.h is handled. Based on a patch by Samuel Cuella <samuel.cuella@supinfo.com>, but cleaned up some to obey local conventions better. All regression tests pass.
Diffstat (limited to 'getsid.c')
-rw-r--r--getsid.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/getsid.c b/getsid.c
new file mode 100644
index 00000000..b6d5313f
--- /dev/null
+++ b/getsid.c
@@ -0,0 +1,16 @@
+/*
+ * This file is Copyright (c) 2010 by the GPSD project
+ * BSD terms apply: see the file COPYING in the distribution root for details.
+ */
+#include "gpsd_config.h"
+
+#ifndef HAVE_GETSID
+#include <unistd.h>
+#include <sys/syscall.h>
+
+/* This implementation is required for Android */
+
+pid_t getsid(pid_t pid) {
+ return syscall(__NR_getsid, pid);
+}
+#endif /* HAVE_GETSID */