Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 28012
b: refs/heads/master
c: 9348f0d
h: refs/heads/master
v: v3
  • Loading branch information
Martin Schwidefsky authored and David Woodhouse committed Jun 14, 2006
1 parent cc6bc2a commit c1b3924
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d27317657ae18cfbc45def8f566e4c3ed1f51d74
refs/heads/master: 9348f0de2d2b541b4ba64fb1f4efee9710a3d731
44 changes: 28 additions & 16 deletions trunk/include/asm-s390/posix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,36 @@ typedef struct {
} __kernel_fsid_t;


#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)

#ifndef _S390_BITOPS_H
#include <asm/bitops.h>
#endif

#undef __FD_SET
#define __FD_SET(fd,fdsetp) set_bit((fd),(fdsetp)->fds_bits)

#undef __FD_CLR
#define __FD_CLR(fd,fdsetp) clear_bit((fd),(fdsetp)->fds_bits)

#undef __FD_ISSET
#define __FD_ISSET(fd,fdsetp) test_bit((fd),(fdsetp)->fds_bits)
#ifdef __KERNEL__

#undef __FD_SET
static inline void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
{
unsigned long _tmp = fd / __NFDBITS;
unsigned long _rem = fd % __NFDBITS;
fdsetp->fds_bits[_tmp] |= (1UL<<_rem);
}

#undef __FD_CLR
static inline void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp)
{
unsigned long _tmp = fd / __NFDBITS;
unsigned long _rem = fd % __NFDBITS;
fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem);
}

#undef __FD_ISSET
static inline int __FD_ISSET(unsigned long fd, const __kernel_fd_set *fdsetp)
{
unsigned long _tmp = fd / __NFDBITS;
unsigned long _rem = fd % __NFDBITS;
return (fdsetp->fds_bits[_tmp] & (1UL<<_rem)) != 0;
}

#undef __FD_ZERO
#define __FD_ZERO(fdsetp) (memset ((fdsetp), 0, sizeof(*(fd_set *)(fdsetp))))
#define __FD_ZERO(fdsetp) \
((void) memset ((__ptr_t) (fdsetp), 0, sizeof (__kernel_fd_set)))

#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)*/
#endif /* __KERNEL__ */

#endif

0 comments on commit c1b3924

Please sign in to comment.