Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add general #ifdef #1

Merged
merged 1 commit into from
Jul 29, 2016
Merged

add general #ifdef #1

merged 1 commit into from
Jul 29, 2016

Conversation

thirdwing
Copy link
Contributor

This PR adds general #ifdef, not for OSX only.

It follows the manner in https://github.com/python/cpython/blob/master/Modules/posixmodule.c#L9551

@eddelbuettel
Copy link
Owner

OMG that is so obviously better.

What do you then get on OS X for library(RcppGetconf); dim(getAll)[1] ? Ie how do we drop from the 320 we on Linux?

Thanks so much.

@eddelbuettel eddelbuettel merged commit 452f3e9 into eddelbuettel:master Jul 29, 2016
eddelbuettel added a commit that referenced this pull request Jul 29, 2016
@thirdwing
Copy link
Contributor Author

On my machine:

> dim(getAll())[1]
[1] 194
> getAll()
                                  key                         value type
1                            LINK_MAX                         32767 path
2                     _POSIX_LINK_MAX                         32767 path
3                           MAX_CANON                               path
4                    _POSIX_MAX_CANON                               path
5                           MAX_INPUT                               path
6                    _POSIX_MAX_INPUT                               path
7                            NAME_MAX                           255 path
8                     _POSIX_NAME_MAX                           255 path
9                            PATH_MAX                          1024 path
10                    _POSIX_PATH_MAX                          1024 path
11                           PIPE_BUF                           512 path
12                    _POSIX_PIPE_BUF                           512 path
13                    _POSIX_ASYNC_IO                             1 path
14            _POSIX_CHOWN_RESTRICTED                        200112 path
15                    _POSIX_NO_TRUNC                        200112 path
16                     _POSIX_PRIO_IO                             0 path
17                     _POSIX_SYNC_IO                             0 path
18                    _POSIX_VDISABLE                               path
19                            ARG_MAX                        262144  sys
20                         ATEXIT_MAX                    2147483647  sys
21                          CHILD_MAX                           709  sys
22                            CLK_TCK                           100  sys
23                        LOGNAME_MAX                           255  sys
24                        NGROUPS_MAX                            16  sys
25                   NSS_BUFLEN_GROUP                          4096  sys
26                  NSS_BUFLEN_PASSWD                          4096  sys
27                           OPEN_MAX                           256  sys
28                           PAGESIZE                          4096  sys
29                          PAGE_SIZE                          4096  sys
30                           PASS_MAX                           128  sys
31      PTHREAD_DESTRUCTOR_ITERATIONS                             4  sys
32                   PTHREAD_KEYS_MAX                           512  sys
33                  PTHREAD_STACK_MIN                          8192  sys
34                PTHREAD_THREADS_MAX                                sys
35                       TTY_NAME_MAX                           255  sys
36                         TZNAME_MAX                           255  sys
37                  _NPROCESSORS_CONF                             4  sys
38                  _NPROCESSORS_ONLN                             4  sys
39                     _POSIX_ARG_MAX                        262144  sys
40             _POSIX_ASYNCHRONOUS_IO                                sys
41                   _POSIX_CHILD_MAX                           709  sys
42                       _POSIX_FSYNC                        200112  sys
43                 _POSIX_JOB_CONTROL                        200112  sys
44                _POSIX_MAPPED_FILES                        200112  sys
45                     _POSIX_MEMLOCK                                sys
46               _POSIX_MEMLOCK_RANGE                                sys
47           _POSIX_MEMORY_PROTECTION                        200112  sys
48             _POSIX_MESSAGE_PASSING                                sys
49                 _POSIX_NGROUPS_MAX                            16  sys
50                    _POSIX_OPEN_MAX                           256  sys
51              _POSIX_PRIORITIZED_IO                                sys
52         _POSIX_PRIORITY_SCHEDULING                                sys
53            _POSIX_REALTIME_SIGNALS                                sys
54                   _POSIX_SAVED_IDS                             1  sys
55                  _POSIX_SEMAPHORES                                sys
56       _POSIX_SHARED_MEMORY_OBJECTS                                sys
57                  _POSIX_STREAM_MAX                           256  sys
58             _POSIX_SYNCHRONIZED_IO                                sys
59                     _POSIX_THREADS                        200112  sys
60       _POSIX_THREAD_ATTR_STACKADDR                        200112  sys
61       _POSIX_THREAD_ATTR_STACKSIZE                        200112  sys
62  _POSIX_THREAD_PRIORITY_SCHEDULING                                sys
63         _POSIX_THREAD_PRIO_INHERIT                                sys
64         _POSIX_THREAD_PRIO_PROTECT                                sys
65       _POSIX_THREAD_PROCESS_SHARED                        200112  sys
66       _POSIX_THREAD_SAFE_FUNCTIONS                        200112  sys
67                      _POSIX_TIMERS                                sys
68                          TIMER_MAX                                sys
69                  _POSIX_TZNAME_MAX                           255  sys
70                     _POSIX_VERSION                        200112  sys
71                       _XOPEN_CRYPT                             1  sys
72                    _XOPEN_ENH_I18N                             1  sys
73                      _XOPEN_LEGACY                                sys
74                    _XOPEN_REALTIME                                sys
75            _XOPEN_REALTIME_THREADS                                sys
76                         _XOPEN_SHM                             1  sys
77                        _XOPEN_UNIX                             1  sys
78                     _XOPEN_VERSION                           600  sys
79                 _XOPEN_XCU_VERSION                             4  sys
80                        BC_BASE_MAX                            99  sys
81                         BC_DIM_MAX                          2048  sys
82                       BC_SCALE_MAX                            99  sys
83                      BC_STRING_MAX                          1000  sys
84                   COLL_WEIGHTS_MAX                             2  sys
85                      EXPR_NEST_MAX                            32  sys
86                           LINE_MAX                          2048  sys
87                 POSIX2_BC_BASE_MAX                            99  sys
88                  POSIX2_BC_DIM_MAX                          2048  sys
89                POSIX2_BC_SCALE_MAX                            99  sys
90               POSIX2_BC_STRING_MAX                          1000  sys
91                   POSIX2_CHAR_TERM                        200112  sys
92            POSIX2_COLL_WEIGHTS_MAX                             2  sys
93                      POSIX2_C_BIND                        200112  sys
94                       POSIX2_C_DEV                        200112  sys
95               POSIX2_EXPR_NEST_MAX                            32  sys
96                    POSIX2_FORT_DEV                                sys
97                    POSIX2_FORT_RUN                        200112  sys
98                   _POSIX2_LINE_MAX                          2048  sys
99                    POSIX2_LINE_MAX                          2048  sys
100                  POSIX2_LOCALEDEF                        200112  sys
101                 POSIX2_RE_DUP_MAX                           255  sys
102                     POSIX2_SW_DEV                        200112  sys
103                        POSIX2_UPE                        200112  sys
104                    POSIX2_VERSION                        200112  sys
105                        RE_DUP_MAX                           255  sys
106                              PATH /usr/bin:/bin:/usr/sbin:/sbin conf
107                           CS_PATH /usr/bin:/bin:/usr/sbin:/sbin conf
108                 _XBS5_ILP32_OFF32                                sys
109           XBS5_ILP32_OFF32_CFLAGS                               conf
110          XBS5_ILP32_OFF32_LDFLAGS                               conf
111             XBS5_ILP32_OFF32_LIBS                               conf
112        XBS5_ILP32_OFF32_LINTFLAGS                               conf
113                _XBS5_ILP32_OFFBIG                             1  sys
114          XBS5_ILP32_OFFBIG_CFLAGS                         -W 32 conf
115         XBS5_ILP32_OFFBIG_LDFLAGS                         -W 32 conf
116            XBS5_ILP32_OFFBIG_LIBS                               conf
117       XBS5_ILP32_OFFBIG_LINTFLAGS                               conf
118                  _XBS5_LP64_OFF64                             1  sys
119            XBS5_LP64_OFF64_CFLAGS                         -W 64 conf
120           XBS5_LP64_OFF64_LDFLAGS                         -W 64 conf
121              XBS5_LP64_OFF64_LIBS                               conf
122         XBS5_LP64_OFF64_LINTFLAGS                               conf
123                _XBS5_LPBIG_OFFBIG                             1  sys
124          XBS5_LPBIG_OFFBIG_CFLAGS                         -W 64 conf
125         XBS5_LPBIG_OFFBIG_LDFLAGS                         -W 64 conf
126            XBS5_LPBIG_OFFBIG_LIBS                               conf
127       XBS5_LPBIG_OFFBIG_LINTFLAGS                               conf
128             _POSIX_V6_ILP32_OFF32                                sys
129       POSIX_V6_ILP32_OFF32_CFLAGS                               conf
130      POSIX_V6_ILP32_OFF32_LDFLAGS                               conf
131         POSIX_V6_ILP32_OFF32_LIBS                               conf
132            _POSIX_V6_ILP32_OFFBIG                             1  sys
133      POSIX_V6_ILP32_OFFBIG_CFLAGS                         -W 32 conf
134     POSIX_V6_ILP32_OFFBIG_LDFLAGS                         -W 32 conf
135        POSIX_V6_ILP32_OFFBIG_LIBS                               conf
136              _POSIX_V6_LP64_OFF64                             1  sys
137        POSIX_V6_LP64_OFF64_CFLAGS                         -W 64 conf
138       POSIX_V6_LP64_OFF64_LDFLAGS                         -W 64 conf
139          POSIX_V6_LP64_OFF64_LIBS                               conf
140            _POSIX_V6_LPBIG_OFFBIG                             1  sys
141      POSIX_V6_LPBIG_OFFBIG_CFLAGS                         -W 64 conf
142     POSIX_V6_LPBIG_OFFBIG_LDFLAGS                         -W 64 conf
143        POSIX_V6_LPBIG_OFFBIG_LIBS                               conf
144              _POSIX_ADVISORY_INFO                                sys
145                   _POSIX_BARRIERS                                sys
146            _POSIX_CLOCK_SELECTION                                sys
147                    _POSIX_CPUTIME                                sys
148             _POSIX_THREAD_CPUTIME                                sys
149               _POSIX_FILE_LOCKING                          4096  sys
150            _POSIX_MONOTONIC_CLOCK                                sys
151        _POSIX_READER_WRITER_LOCKS                        200112  sys
152                 _POSIX_SPIN_LOCKS                                sys
153                     _POSIX_REGEXP                        200112  sys
154                      _POSIX_SHELL                        200112  sys
155                      _POSIX_SPAWN                                sys
156            _POSIX_SPORADIC_SERVER                                sys
157     _POSIX_THREAD_SPORADIC_SERVER                                sys
158                   _POSIX_TIMEOUTS                                sys
159       _POSIX_TYPED_MEMORY_OBJECTS                                sys
160                        POSIX2_PBS                                sys
161             POSIX2_PBS_ACCOUNTING                                sys
162                 POSIX2_PBS_LOCATE                                sys
163                  POSIX2_PBS_TRACK                                sys
164                POSIX2_PBS_MESSAGE                                sys
165                       SYMLOOP_MAX                            32  sys
166                        STREAM_MAX                           256  sys
167                    AIO_LISTIO_MAX                            90  sys
168                           AIO_MAX                            90  sys
169                AIO_PRIO_DELTA_MAX                                sys
170                    DELAYTIMER_MAX                                sys
171                     HOST_NAME_MAX                           255  sys
172                    LOGIN_NAME_MAX                           255  sys
173                       MQ_OPEN_MAX                                sys
174                       MQ_PRIO_MAX                                sys
175                      _POSIX_TRACE                                sys
176         _POSIX_TRACE_EVENT_FILTER                                sys
177              _POSIX_TRACE_INHERIT                                sys
178                  _POSIX_TRACE_LOG                                sys
179                         RTSIG_MAX                                sys
180                     SEM_NSEMS_MAX                         87381  sys
181                     SEM_VALUE_MAX                         32767  sys
182                      SIGQUEUE_MAX                                sys
183                      FILESIZEBITS                            64 path
184              POSIX_ALLOC_SIZE_MIN                             1 path
185          POSIX_REC_INCR_XFER_SIZE                          4096 path
186           POSIX_REC_MAX_XFER_SIZE                         65536 path
187           POSIX_REC_MIN_XFER_SIZE                          4096 path
188              POSIX_REC_XFER_ALIGN                          4096 path
189                       SYMLINK_MAX                           255 path
190                   POSIX2_SYMLINKS                             1 path
191                              IPV6                        200112  sys
192                       RAW_SOCKETS                                sys
193                       _POSIX_IPV6                        200112  sys
194                _POSIX_RAW_SOCKETS                                sys
> 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants