[rtems-libbsd commit] Move content to <machine/rtems-bsd-user-space.h>
Sebastian Huber
sebh at rtems.org
Mon Nov 11 09:02:11 UTC 2013
Module: rtems-libbsd
Branch: master
Commit: b84c04ecfa2cb5502d1c35e3729879eeec720b3c
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=b84c04ecfa2cb5502d1c35e3729879eeec720b3c
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Wed Nov 6 09:11:47 2013 +0100
Move content to <machine/rtems-bsd-user-space.h>
---
freebsd/lib/libc/db/db/db.c | 7 ------
freebsd/sbin/dhclient/dhclient.c | 7 ------
rtemsbsd/include/machine/rtems-bsd-user-space.h | 24 +++++++++++++++++++++++
3 files changed, 24 insertions(+), 14 deletions(-)
diff --git a/freebsd/lib/libc/db/db/db.c b/freebsd/lib/libc/db/db/db.c
index 2cfb0bb..b6b4a5e 100644
--- a/freebsd/lib/libc/db/db/db.c
+++ b/freebsd/lib/libc/db/db/db.c
@@ -51,13 +51,6 @@ dbopen(const char *fname, int flags, int mode, DBTYPE type, const void *openinfo
{
#define DB_FLAGS (DB_LOCK | DB_SHMEM | DB_TXN)
-#ifdef __rtems__
-/* FIXME: Add lock capabilities to RTEMS file system */
-#define O_EXLOCK 0
-#define O_SHLOCK 0
-/* FIXME: Add no symlink follow capabilities to RTEMS file system */
-#define O_NOFOLLOW 0
-#endif /* __rtems__ */
#define USE_OPEN_FLAGS \
(O_CREAT | O_EXCL | O_EXLOCK | O_NOFOLLOW | O_NONBLOCK | \
O_RDONLY | O_RDWR | O_SHLOCK | O_SYNC | O_TRUNC)
diff --git a/freebsd/sbin/dhclient/dhclient.c b/freebsd/sbin/dhclient/dhclient.c
index 30d05d2..9782498 100644
--- a/freebsd/sbin/dhclient/dhclient.c
+++ b/freebsd/sbin/dhclient/dhclient.c
@@ -384,9 +384,6 @@ main(int argc, char *argv[])
usage();
if (path_dhclient_pidfile == NULL) {
-#ifdef __rtems__
-#define _PATH_VARRUN "/var/run"
-#endif /* __rtems__ */
asprintf(&path_dhclient_pidfile,
"%sdhclient.%s.pid", _PATH_VARRUN, *argv);
if (path_dhclient_pidfile == NULL)
@@ -464,10 +461,6 @@ main(int argc, char *argv[])
close(pipe_fd[0]);
privfd = pipe_fd[1];
-#ifdef __rtems__
-/* FIXME: Add O_EXLOCK capabilities to RTEMS file system */
-#define O_EXLOCK 0
-#endif /* __rtems__ */
if ((fd = open(path_dhclient_db, O_RDONLY|O_EXLOCK|O_CREAT, 0)) == -1)
error("can't open and lock %s: %m", path_dhclient_db);
read_client_leases();
diff --git a/rtemsbsd/include/machine/rtems-bsd-user-space.h b/rtemsbsd/include/machine/rtems-bsd-user-space.h
index a79d452..dddfa86 100644
--- a/rtemsbsd/include/machine/rtems-bsd-user-space.h
+++ b/rtemsbsd/include/machine/rtems-bsd-user-space.h
@@ -40,4 +40,28 @@
#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_USER_SPACE_H_
#define _RTEMS_BSD_MACHINE_RTEMS_BSD_USER_SPACE_H_
+#include <sys/cdefs.h>
+
+#include <stdio.h>
+
+/* FIXME: Add lock capabilities to RTEMS file system */
+#define O_EXLOCK 0
+#define O_SHLOCK 0
+
+/* FIXME: Add no symlink follow capabilities to RTEMS file system */
+#define O_NOFOLLOW 0
+
+#define _PATH_VARRUN "/var/run"
+
+__BEGIN_DECLS
+
+/* FIXME: Add to Newlib */
+long long strtonum(const char *numstr, long long minval, long long maxval,
+ const char **errstrp);
+
+/* FIXME: Add to Newlib */
+char *fgetln(FILE *fp, size_t *lenp);
+
+__END_DECLS
+
#endif /* _RTEMS_BSD_MACHINE_RTEMS_BSD_USER_SPACE_H_ */
More information about the vc
mailing list