Line
Link Here
|
0 |
-- kBuild-0.1.9998-pre20120806/src/kmk/kmkbuiltin/chmod.c |
0 |
++ kBuild-0.1.9998-pre20120806-uclibc/src/kmk/kmkbuiltin/chmod.c |
Lines 83-88
static struct option long_options[] =
Link Here
|
83 |
{ 0, 0, 0, 0 }, |
83 |
{ 0, 0, 0, 0 }, |
84 |
}; |
84 |
}; |
85 |
|
85 |
|
|
|
86 |
#ifdef __UCLIBC__ |
87 |
static int |
88 |
lchmod(const char *path, mode_t mode) |
89 |
{ |
90 |
struct stat s; |
91 |
|
92 |
if (lstat(path, &s) < 0) { |
93 |
return -1; |
94 |
} |
95 |
if ((s.st_mode & S_IFMT) != S_IFLNK) { |
96 |
return chmod(path, mode); |
97 |
} else { /* On Linux, symlinks always have default permissions */ |
98 |
return 0; |
99 |
} |
100 |
} |
101 |
#endif |
86 |
|
102 |
|
87 |
int |
103 |
int |
88 |
kmk_builtin_chmod(int argc, char *argv[], char **envp) |
104 |
kmk_builtin_chmod(int argc, char *argv[], char **envp) |
89 |
-- kBuild-0.1.9998-pre20120806/src/kmk/kmkbuiltin/cp.c |
105 |
++ kBuild-0.1.9998-pre20120806-uclibc/src/kmk/kmkbuiltin/cp.c |
Lines 82-89
__FBSDID("$FreeBSD: src/bin/cp/cp.c,v 1.
Link Here
|
82 |
#include "kbuild_protection.h" |
82 |
#include "kbuild_protection.h" |
83 |
|
83 |
|
84 |
#if defined(_MSC_VER) || defined(__gnu_linux__) || defined(__linux__) |
84 |
#if defined(_MSC_VER) || defined(__gnu_linux__) || defined(__linux__) |
|
|
85 |
#ifndef __UCLIBC__ |
85 |
extern char *strlcpy(char *, const char *, size_t); |
86 |
extern char *strlcpy(char *, const char *, size_t); |
86 |
#endif |
87 |
#endif |
|
|
88 |
#endif |
87 |
|
89 |
|
88 |
|
90 |
|
89 |
#ifndef S_IFWHT |
91 |
#ifndef S_IFWHT |
90 |
-- kBuild-0.1.9998-pre20120806/src/kmk/kmkbuiltin/cp_utils.c |
92 |
++ kBuild-0.1.9998-pre20120806-uclibc/src/kmk/kmkbuiltin/cp_utils.c |
Lines 84-89
__FBSDID("$FreeBSD: src/bin/cp/utils.c,v
Link Here
|
84 |
# define S_ISVTX 0 |
84 |
# define S_ISVTX 0 |
85 |
#endif |
85 |
#endif |
86 |
|
86 |
|
|
|
87 |
#ifdef __UCLIBC__ |
88 |
/* Fake lchmod because Linux symlinks always have mode 0777 */ |
89 |
static inline int lchmod(const char* path, mode_t mode) |
90 |
{ |
91 |
return 0; |
92 |
} |
93 |
#endif |
87 |
|
94 |
|
88 |
int |
95 |
int |
89 |
copy_file(const FTSENT *entp, int dne, int changed_only, int *pcopied) |
96 |
copy_file(const FTSENT *entp, int dne, int changed_only, int *pcopied) |
90 |
-- kBuild-0.1.9998-pre20120806/src/kmk/kmkbuiltin/fts.c |
97 |
++ kBuild-0.1.9998-pre20120806-uclibc/src/kmk/kmkbuiltin/fts.c |
Lines 75-81
__RCSID("$NetBSD: __fts13.c,v 1.44 2005/
Link Here
|
75 |
#endif |
75 |
#endif |
76 |
|
76 |
|
77 |
#if ! HAVE_NBTOOL_CONFIG_H |
77 |
#if ! HAVE_NBTOOL_CONFIG_H |
78 |
# if !defined(__sun__) && !defined(__gnu_linux__) && !defined(__HAIKU__) |
78 |
# if !defined(__sun__) && !defined(__gnu_linux__) && !defined(__HAIKU__) && !defined(__UCLIBC__) |
79 |
# define HAVE_STRUCT_DIRENT_D_NAMLEN 1 |
79 |
# define HAVE_STRUCT_DIRENT_D_NAMLEN 1 |
80 |
# endif |
80 |
# endif |
81 |
#endif |
81 |
#endif |
82 |
-- kBuild-0.1.9998-pre20120806/src/lib/k/kDefs.h |
82 |
++ kBuild-0.1.9998-pre20120806-uclibc/src/lib/k/kDefs.h |
Lines 82-88
Link Here
|
82 |
# define K_OS K_OS_FREEBSD |
82 |
# define K_OS K_OS_FREEBSD |
83 |
# elif defined(__HAIKU__) |
83 |
# elif defined(__HAIKU__) |
84 |
# define K_OS K_OS_HAIKU |
84 |
# define K_OS K_OS_HAIKU |
85 |
# elif defined(__gnu_linux__) |
85 |
# elif defined(__gnu_linux__) || defined(__UCLIBC__) |
86 |
# define K_OS K_OS_LINUX |
86 |
# define K_OS K_OS_LINUX |
87 |
# elif defined(__NetBSD__) /*??*/ |
87 |
# elif defined(__NetBSD__) /*??*/ |
88 |
# define K_OS K_OS_NETBSD |
88 |
# define K_OS K_OS_NETBSD |
89 |
-- kBuild-0.1.9998-pre20120806/src/kmk/job.c |
89 |
++ kBuild-0.1.9998-pre20120806-uclibc2/src/kmk/job.c |
Lines 195-201
int getgid ();
Link Here
|
195 |
# endif |
195 |
# endif |
196 |
#endif |
196 |
#endif |
197 |
|
197 |
|
|
|
198 |
#ifndef __UCLIBC__ |
198 |
int getloadavg (double loadavg[], int nelem); |
199 |
int getloadavg (double loadavg[], int nelem); |
|
|
200 |
#endif |
199 |
int start_remote_job (char **argv, char **envp, int stdin_fd, int *is_remote, |
201 |
int start_remote_job (char **argv, char **envp, int stdin_fd, int *is_remote, |
200 |
int *id_ptr, int *used_stdin); |
202 |
int *id_ptr, int *used_stdin); |
201 |
int start_remote_job_p (int); |
203 |
int start_remote_job_p (int); |
Lines 2050-2055
job_next_command (struct child *child)
Link Here
|
2050 |
#define LOAD_WEIGHT_A 0.25 |
2052 |
#define LOAD_WEIGHT_A 0.25 |
2051 |
#define LOAD_WEIGHT_B 0.25 |
2053 |
#define LOAD_WEIGHT_B 0.25 |
2052 |
|
2054 |
|
|
|
2055 |
#ifdef __UCLIBC__ |
2056 |
static int getloadavg(double loadavg[], int nelem) |
2057 |
{ |
2058 |
int read = 0; |
2059 |
if ((nelem > 0) && (loadavg != NULL)) { |
2060 |
FILE* loadavgfile = fopen("/proc/loadavg", "r"); |
2061 |
if (loadavgfile != NULL) { |
2062 |
if (nelem == 1) { |
2063 |
read = fscanf(loadavgfile, "%lf", &loadavg[0]); |
2064 |
} else if (nelem == 2) { |
2065 |
read = fscanf(loadavgfile, "%lf %lf", &loadavg[0], &loadavg[1]); |
2066 |
} else if (nelem >= 3) { |
2067 |
read = fscanf(loadavgfile, "%lf %lf %lf", &loadavg[0], &loadavg[1], &loadavg[2]); |
2068 |
} |
2069 |
fclose(loadavgfile); |
2070 |
} |
2071 |
} |
2072 |
return read; |
2073 |
} |
2074 |
#endif |
2075 |
|
2053 |
static int |
2076 |
static int |
2054 |
load_too_high (void) |
2077 |
load_too_high (void) |
2055 |
{ |
2078 |
{ |