File: hurd-sem_init

package info (click to toggle)
postgresql-9.6 9.6.17-0%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 129,840 kB
  • sloc: ansic: 743,530; sql: 67,512; xml: 30,901; yacc: 30,445; perl: 16,302; lex: 7,822; sh: 5,290; makefile: 4,780; python: 112; asm: 65; sed: 15
file content (36 lines) | stat: -rw-r--r-- 1,018 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
hurd doesn't support sysv semaphores (semget), and needs -pthread to find
sem_init. POSIX semaphores shared between processes (sem_init(pshared = 1))
aren't supported yet either, but have the best chance to get implemented, so be
prepared.

FATAL:  could not create semaphores: Function not implemented
DETAIL:  Failed system call was semget(1, 17, 03600).

undefined reference to symbol 'sem_init@@GLIBC_2.12'

--- a/src/backend/Makefile
+++ b/src/backend/Makefile
@@ -109,6 +109,10 @@ endif
 
 endif # aix
 
+ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH_OS), hurd)
+LIBS += -pthread
+endif # hurd
+
 # Update the commonly used headers before building the subdirectories
 $(SUBDIRS:%=%-recursive): | generated-headers
 
--- a/src/template/linux
+++ b/src/template/linux
@@ -28,3 +28,10 @@ if test "$SUN_STUDIO_CC" = "yes" ; then
     ;;
   esac
 fi
+
+# force use of POSIX instead of SysV semaphores on hurd-i386
+case $(dpkg-architecture -qDEB_HOST_ARCH) in
+	hurd*)
+		USE_UNNAMED_POSIX_SEMAPHORES=1
+		;;
+esac