This is the mail archive of the mailing list for the newlib project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/7] New path defines for <paths.h>

Hello Corinna,

thanks for your review.

On 2013-10-14 17:35, Corinna Vinschen wrote:
On Oct  8 14:45, Sebastian Huber wrote:
2013-10-08  Sebastian Huber <>

	* libc/include/paths.h (_PATH_DEVNULL): Define.
	(_PATH_DEVZERO): Likewise.
  newlib/libc/include/paths.h |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/newlib/libc/include/paths.h b/newlib/libc/include/paths.h
index 36cf78a..b1c70f5 100644
--- a/newlib/libc/include/paths.h
+++ b/newlib/libc/include/paths.h
@@ -2,6 +2,8 @@
  #define _PATHS_H_

  #define _PATH_DEV	"/dev/"
+#define _PATH_DEVNULL   "/dev/null"
+#define _PATH_DEVZERO   "/dev/zero"

Why these two?

I work currently on a port of the FreeBSD network stack to RTEMS. The stack is configured with FreeBSD command line tools, e.g. ifconfig, route, dhclient, etc. Some of them require one of the new path defines.

Why for all targets?  _PATH_DEV and _PATH_BSHELL are
used in newlib(*), but the additional definition of only _PATH_DEVNULL
and _PATH_DEVZERO looks a bit arbitrary.  What's the reason?

I thought that adding some underscore names to a path already existing (_PATH_DEV) cannot harm.

And, wouldn't it make sense to either keep paths.h as is and require
target-specific overrides, or, alternatively, add everything and the
kitchen sink to paths.h by providing the full BSD version of the file?

The full FreeBSD version contains a lot of stuff

and may confuse users if the actual paths don't match the one of their system.

In this case I think a RTEMS specific version is the best option if you don't want to pollute the general Newlib version of this file.

  #define _PATH_BSHELL    "/bin/sh"

  #endif /* _PATHS_H_ */


(*) as is _PATH_PASSWD, but that's local to getpass.c for some,
     probably historical reason.

Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  :
PGP     : Public key available on request.

Diese Nachricht ist keine geschÃftliche Mitteilung im Sinne des EHUG.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]