ext/common/Utils/IOUtils.h in passenger-5.0.9 vs ext/common/Utils/IOUtils.h in passenger-5.0.10

- old
+ new

@@ -93,10 +93,18 @@ * @throw ArgumentException <tt>address</tt> is not a valid TCP socket address. */ bool isLocalSocketAddress(const StaticString &address); /** + * Sets a socket in blocking mode. + * + * @throws SystemException Something went wrong. + * @ingroup Support + */ +void setBlocking(int fd); + +/** * Sets a socket in non-blocking mode. * * @throws SystemException Something went wrong. * @ingroup Support */ @@ -588,9 +596,20 @@ * @throws TimeoutException Unable to pass the file descriptor within * <tt>timeout</tt> microseconds. * @throws boost::thread_interrupted */ void writeFileDescriptor(int fd, int fdToSend, unsigned long long *timeout = NULL); + +/** + * Return the effective UID and GID of the peer connected to a Unix domain socket. + * + * @throws SystemException Something went wrong. If reading credentials over a Unix + * domain socket is not supported for the current platform, + * then the error code is ENOSYS. If the socket does not + * support credentials passing, then the error code is + * EPROTONOSUPPORT. + */ +void readPeerCredentials(int sock, uid_t *uid, gid_t *gid); /** * Closes the given file descriptor and throws an exception if anything goes wrong. * This function also works around certain close() bugs and quirks on certain * operating systems, such as the FreeBSD ENOTCONN-on-close bug and the fact that