Hi! Played around with prex and make small sysconf() call. May be it will
be useful for someone.
diff -Nru prex-0.9.0/usr/include/unistd.h prex-0.9.0.toch/usr/include/unistd.h
--- prex-0.9.0/usr/include/unistd.h 2009-10-01 12:15:49.000000000 +0000
+++ prex-0.9.0.toch/usr/include/unistd.h 2009-10-08 19:51:26.000000000
+0000
@@ -43,6 +43,17 @@
#define NULL 0 /* null pointer constant */
#endif
+#define _SC_ARG_MAX 1
+#define _SC_CHILD_MAX 2
+#define _SC_CLK_TCK 3
+#define _SC_STREAM_MAX 4
+#define _SC_TZNAME_MAX 5
+#define _SC_OPEN_MAX 6
+#define _SC_JOB_CONTROL 7
+#define _SC_SAVED_IDS 8
+#define _SC_VERSION 9
+
+
__BEGIN_DECLS
int access(const char *, int);
unsigned int alarm(unsigned int);
@@ -85,7 +96,7 @@
pid_t setsid(void);
int setuid(uid_t);
unsigned int sleep(unsigned int);
-/* long sysconf(int); */
+long sysconf(int);
pid_t tcgetpgrp(int);
int tcsetpgrp(int, pid_t);
/* char *ttyname(int); */
diff -Nru prex-0.9.0/usr/lib/posix/gen/Makefile.inc
prex-0.9.0.toch/usr/lib/posix/gen/Makefile.inc
--- prex-0.9.0/usr/lib/posix/gen/Makefile.inc 2009-06-12 23:47:50.000000000
+0000
+++ prex-0.9.0.toch/usr/lib/posix/gen/Makefile.inc 2009-10-08
18:55:50.000000000 +0000
@@ -1,4 +1,4 @@
VPATH:= $(SRCDIR)/usr/lib/posix/gen:$(VPATH)
SRCS+= __posix_init.c __posix_call.c uname.c syslog.c alarm.c \
- getrlimit.c
+ getrlimit.c sysconf.c
diff -Nru prex-0.9.0/usr/lib/posix/gen/sysconf.c
prex-0.9.0.toch/usr/lib/posix/gen/sysconf.c
--- prex-0.9.0/usr/lib/posix/gen/sysconf.c 1970-01-01 00:00:00.000000000
+0000
+++ prex-0.9.0.toch/usr/lib/posix/gen/sysconf.c 2009-10-22 18:24:20.000000000
+0000
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2009, Dmitriy Tochansky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of any co-contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <unistd.h>
+#include <sys/time.h>
+#include <sys/errno.h>
+
+long
+sysconf(int name)
+{
+ switch( name )
+ {
+ case _SC_ARG_MAX: return ARG_MAX;
+ case _SC_CHILD_MAX: return MAXTASKS;
+ case _SC_STREAM_MAX: return OPEN_MAX;
+ case _SC_CLK_TCK: return CLK_TCK;
+ case _SC_OPEN_MAX: return OPEN_MAX;
+ default:
+ return EINVAL;
+
+ }
+ return -1;
+}------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Prex-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/prex-devel