• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
multiple symbols of select(), do they matter?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

multiple symbols of select(), do they matter?


  • Subject: multiple symbols of select(), do they matter?
  • From: Luke Daley <email@hidden>
  • Date: Sun, 7 Sep 2008 10:57:43 +1000

Hi,

For my library that interposes read(), write(), open(), close() and select(), I am wondering if I need to be a bit smarter about what I do depending on which _variant_ of each of these is actually called. My select() stuff looks like this…

int select(int, fd_set * __restrict, fd_set * __restrict, fd_set * __restrict, struct timeval * __restrict) __asm("_select");
int select_darwinextsn(int, fd_set * __restrict, fd_set * __restrict, fd_set * __restrict, struct timeval * __restrict) __asm("_select $DARWIN_EXTSN");
int select_darwinextsn_nocancel(int, fd_set * __restrict, fd_set * __restrict, fd_set * __restrict, struct timeval * __restrict) __asm("_select$DARWIN_EXTSN$NOCANCEL");
int select_nocancel_unix2003(int, fd_set * __restrict, fd_set * __restrict, fd_set * __restrict, struct timeval * __restrict) __asm("_select$NOCANCEL$UNIX2003");
int select_unix2003(int, fd_set * __restrict, fd_set * __restrict, fd_set * __restrict, struct timeval * __restrict) __asm("_select $UNIX2003");


int select(int nfds, fd_set * __restrict readfds, fd_set * __restrict writefds, fd_set * __restrict errorfds, struct timeval * __restrict timeout) {
// my code
int (*real_select)(int nfds, fd_set * __restrict readfds, fd_set * __restrict writefds, fd_set * __restrict errorfds, struct timeval * __restrict timeout) = dlsym(RTLD_NEXT, "select");
result = real_select(nfds, readfds, writefds, errorfds, timeout);
// my code
return result;
}


int select_darwinextsn(int nfds, fd_set * __restrict readfds, fd_set * __restrict writefds, fd_set * __restrict errorfds, struct timeval * __restrict timeout) {
return select(nfds, readfds, writefds, errorfds, timeout);
}


int select_darwinextsn_nocancel(int nfds, fd_set * __restrict readfds, fd_set * __restrict writefds, fd_set * __restrict errorfds, struct timeval * __restrict timeout) {
return select(nfds, readfds, writefds, errorfds, timeout);
}


int select_nocancel_unix2003(int nfds, fd_set * __restrict readfds, fd_set * __restrict writefds, fd_set * __restrict errorfds, struct timeval * __restrict timeout) {
return select(nfds, readfds, writefds, errorfds, timeout);
}


int select_unix2003(int nfds, fd_set * __restrict readfds, fd_set * __restrict writefds, fd_set * __restrict errorfds, struct timeval * __restrict timeout) {
return select(nfds, readfds, writefds, errorfds, timeout);
}


So my question is really two parts; Do they different variants of select() in libSystem actually do different things? And should I be actually fetching the implementation with dlsym() that matches what was actually called by the client of my code?

For example, the 'NOCANCEL' variant makes me nervous, seems like I should be doing something there. But, I have no idea what.

I am asking this for read(), write(), open() and close() as well.

Thanks,

--

LD.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: multiple symbols of select(), do they matter?
      • From: Jean-Daniel Dupas <email@hidden>
  • Prev by Date: Re: CFFileDescriptor and stdin
  • Next by Date: Re: multiple symbols of select(), do they matter?
  • Previous by thread: Re: CFFileDescriptor and stdin
  • Next by thread: Re: multiple symbols of select(), do they matter?
  • Index(es):
    • Date
    • Thread