comparison lib/portability.c @ 1665:5d003cc2fa16 draft

Lift the basename/libgen.h shenanigans back out of portability.c and make it a static inline in portability.h, and prototype dirname() while we're at it.
author Rob Landley <rob@landley.net>
date Sun, 18 Jan 2015 13:44:24 -0600
parents aafd2f28245a
children 1b97da3c7b91
comparison
equal deleted inserted replaced
1664:692be264d4f0 1665:5d003cc2fa16
3 * Copyright 2012 Rob Landley <rob@landley.net> 3 * Copyright 2012 Rob Landley <rob@landley.net>
4 * Copyright 2012 Georgi Chorbadzhiyski <gf@unixsol.org> 4 * Copyright 2012 Georgi Chorbadzhiyski <gf@unixsol.org>
5 */ 5 */
6 6
7 #include "toys.h" 7 #include "toys.h"
8
9 #if defined(__GLIBC__)
10 #include <libgen.h>
11 char *basename(char *path)
12 {
13 return __xpg_basename(path);
14 }
15 #endif
16 8
17 #if !defined(__uClinux__) 9 #if !defined(__uClinux__)
18 pid_t xfork(void) 10 pid_t xfork(void)
19 { 11 {
20 pid_t pid = fork(); 12 pid_t pid = fork();