2 * udev_libc_wrapper - wrapping of functions missing in a specific libc
3 * or not working in a statically compiled binary
5 * Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation version 2 of the License.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef _UDEV_LIBC_WRAPPER_H_
23 #define _UDEV_LIBC_WRAPPER_H_
27 #define asmlinkage __attribute__((regparm(0)))
33 #define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
36 #define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
39 #define __FD_ISSET(d, set) (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0)
42 #define __FD_ZERO(set) ((void) memset ((void*) (set), 0, sizeof (fd_set)))
45 #ifndef NETLINK_KOBJECT_UEVENT
46 #define NETLINK_KOBJECT_UEVENT 15
52 static inline int clearenv(void)
59 extern uid_t lookup_user(const char *user);
60 extern gid_t lookup_group(const char *group);
62 extern size_t strlcpy(char *dst, const char *src, size_t size);
63 extern size_t strlcat(char *dst, const char *src, size_t size);
65 #endif /* _UDEV_LIBC_WRAPPER_H_ */