소스 검색

- emulate unavailable syscall getpgrp on e.g. ia64 (Stefan Assmann)

Bernhard Reutner-Fischer 15 년 전
부모
커밋
e835d2bf21
1개의 변경된 파일13개의 추가작업 그리고 1개의 파일을 삭제
  1. 13 1
      libc/sysdeps/linux/common/getpgrp.c

+ 13 - 1
libc/sysdeps/linux/common/getpgrp.c

@@ -2,7 +2,7 @@
 /*
  * getpgrp() for uClibc
  *
- * Copyright (C) 2000-2006 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2008 by Erik Andersen <andersen@codepoet.org>
  *
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  */
@@ -13,4 +13,16 @@
 #ifdef __NR_getpgrp
 /* According to the manpage the POSIX.1 version is favoured */
 _syscall0(pid_t, getpgrp)
+#elif defined __NR_getpgid && (defined __NR_getpid || defined __NR_getxpid)
+/* IA64 doesn't have a getpgrp syscall */
+pid_t getpgrp(void)
+{
+	return getpgid(getpid());
+}
+#elif defined __UCLIBC_HAS_STUBS__
+pid_t getpgrp(void)
+{
+	__set_errno(ENOSYS);
+	return -1;
+}
 #endif