[haiku-commits] r41583 - in haiku/branches/developer/bonefish/signals: headers/posix headers/private/system src/system/libroot/posix/unistd

Author: bonefish
Date: 2011-05-19 18:54:59 +0200 (Thu, 19 May 2011)
New Revision: 41583
Changeset: https://dev.haiku-os.org/changeset/41583

Added:
   
haiku/branches/developer/bonefish/signals/headers/private/system/signal_defs.h
Modified:
   haiku/branches/developer/bonefish/signals/headers/posix/unistd.h
   
haiku/branches/developer/bonefish/signals/src/system/libroot/posix/unistd/conf.c
Log:
* Added _POSIX_SIGQUEUE_MAX and _SC_SIGQUEUE_MAX macros to <unistd.h>. Handle
  the latter in sysconf().
* Added new private header/private/system/signal_defs.h defining
  MAX_QUEUED_SIGNALS, the actual signal queuing limit.


Modified: haiku/branches/developer/bonefish/signals/headers/posix/unistd.h
===================================================================
--- haiku/branches/developer/bonefish/signals/headers/posix/unistd.h    
2011-05-19 16:50:33 UTC (rev 41582)
+++ haiku/branches/developer/bonefish/signals/headers/posix/unistd.h    
2011-05-19 16:54:59 UTC (rev 41583)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2010 Haiku Inc. All Rights Reserved.
+ * Copyright 2004-2011 Haiku, Inc. All Rights Reserved.
  * Distributed under the terms of the MIT License.
  */
 #ifndef _UNISTD_H_
@@ -48,6 +48,7 @@
 #define _POSIX_REALTIME_SIGNALS                                (-1)    /* 
currently unsupported */
 #define _POSIX_MEMORY_PROTECTION                       (200809L)
 #define _POSIX_SEM_VALUE_MAX                           INT_MAX
+#define        _POSIX_SIGQUEUE_MAX                                     32
 
 /* pathconf() constants */
 /* BeOS supported values, do not touch */
@@ -119,6 +120,7 @@
 #define _SC_THREAD_PRIORITY_SCHEDULING 50
 #define _SC_REALTIME_SIGNALS                   51
 #define        _SC_MEMORY_PROTECTION                   52
+#define _SC_SIGQUEUE_MAX                               53
 
 
 /* confstr() constants */

Added: 
haiku/branches/developer/bonefish/signals/headers/private/system/signal_defs.h
===================================================================
--- 
haiku/branches/developer/bonefish/signals/headers/private/system/signal_defs.h  
                            (rev 0)
+++ 
haiku/branches/developer/bonefish/signals/headers/private/system/signal_defs.h  
    2011-05-19 16:54:59 UTC (rev 41583)
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2011, Ingo Weinhold, ingo_weinhold@xxxxxxx
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef _SYSTEM_SIGNAL_DEFS_H
+#define _SYSTEM_SIGNAL_DEFS_H
+
+
+#include <unistd.h>
+
+
+// The total number of signals a process may have queued at receivers at any
+// time.
+#define MAX_QUEUED_SIGNALS                     _POSIX_SIGQUEUE_MAX
+
+
+#endif /* _SYSTEM_SIGNAL_DEFS_H */

Modified: 
haiku/branches/developer/bonefish/signals/src/system/libroot/posix/unistd/conf.c
===================================================================
--- 
haiku/branches/developer/bonefish/signals/src/system/libroot/posix/unistd/conf.c
    2011-05-19 16:50:33 UTC (rev 41582)
+++ 
haiku/branches/developer/bonefish/signals/src/system/libroot/posix/unistd/conf.c
    2011-05-19 16:54:59 UTC (rev 41583)
@@ -18,10 +18,11 @@
 #include <fs_info.h>
 #include <libroot_private.h>
 #include <posix/realtime_sem_defs.h>
+#include <signal_defs.h>
+#include <syscalls.h>
 #include <thread_defs.h>
 #include <user_group.h>
 
-bool _kern_cpu_enabled(int cpu);
 
 int
 getdtablesize(void)
@@ -38,7 +39,8 @@
 sysconf(int name)
 {
        int err;
-       // TODO: This is about what BeOS does, better POSIX conformance would 
be nice, though
+       // TODO: This is about what BeOS does, better POSIX conformance would be
+       // nice, though
 
        switch (name) {
                case _SC_ARG_MAX:
@@ -147,6 +149,8 @@
                        return _POSIX_REALTIME_SIGNALS;
                case _SC_MEMORY_PROTECTION:
                        return _POSIX_MEMORY_PROTECTION;
+               case _SC_SIGQUEUE_MAX:
+                       return MAX_QUEUED_SIGNALS;
 
                // not POSIX (anymore)
                case _SC_PIPE:


Other related posts:

  • » [haiku-commits] r41583 - in haiku/branches/developer/bonefish/signals: headers/posix headers/private/system src/system/libroot/posix/unistd - ingo_weinhold