chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update Fedora rules
[elogind.git]
/
udev_libc_wrapper.h
diff --git
a/udev_libc_wrapper.h
b/udev_libc_wrapper.h
index 4d6d332c691255e7e1ae001c67d3933f83e47bb7..9dd22175cd5a15964843ad054b4ea89bfb2be526 100644
(file)
--- a/
udev_libc_wrapper.h
+++ b/
udev_libc_wrapper.h
@@
-22,6
+22,11
@@
#ifndef _UDEV_LIBC_WRAPPER_H_
#define _UDEV_LIBC_WRAPPER_H_
#ifndef _UDEV_LIBC_WRAPPER_H_
#define _UDEV_LIBC_WRAPPER_H_
+#include <string.h>
+#include <unistd.h>
+#include <linux/types.h>
+
+/* needed for our signal handlers to work */
#undef asmlinkage
#ifdef __i386__
#define asmlinkage __attribute__((regparm(0)))
#undef asmlinkage
#ifdef __i386__
#define asmlinkage __attribute__((regparm(0)))
@@
-29,6
+34,7
@@
#define asmlinkage
#endif
#define asmlinkage
#endif
+/* headers are broken on some lazy platforms */
#ifndef __FD_SET
#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
#endif
#ifndef __FD_SET
#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
#endif
@@
-42,17
+48,23
@@
#define __FD_ZERO(set) ((void) memset ((void*) (set), 0, sizeof (fd_set)))
#endif
#define __FD_ZERO(set) ((void) memset ((void*) (set), 0, sizeof (fd_set)))
#endif
-#include <string.h>
+/* missing in some lazy distros */
+#ifndef NETLINK_KOBJECT_UEVENT
+#define NETLINK_KOBJECT_UEVENT 15
+#endif
+
+#ifdef __KLIBC__
+static inline int clearenv(void)
+{
+ environ[0] = NULL;
+ return 0;
+}
+#endif
extern uid_t lookup_user(const char *user);
extern gid_t lookup_group(const char *group);
extern uid_t lookup_user(const char *user);
extern gid_t lookup_group(const char *group);
-#ifndef strlcat
extern size_t strlcpy(char *dst, const char *src, size_t size);
extern size_t strlcpy(char *dst, const char *src, size_t size);
-#endif
-
-#ifndef strlcat
extern size_t strlcat(char *dst, const char *src, size_t size);
extern size_t strlcat(char *dst, const char *src, size_t size);
-#endif
#endif /* _UDEV_LIBC_WRAPPER_H_ */
#endif /* _UDEV_LIBC_WRAPPER_H_ */