}
#endif /* HAVE_FOPEN64 */
+static void swrap_inject_o_largefile(int *flags)
+{
+ (void)*flags; /* maybe unused */
+#if SIZE_MAX == 0xffffffffUL && defined(O_LARGEFILE)
+#ifdef O_PATH
+ if (((*flags) & O_PATH) == 0)
+#endif
+ {
+ *flags |= O_LARGEFILE;
+ }
+#endif
+}
+
static int libc_vopen(const char *pathname, int flags, va_list ap)
{
int mode = 0;
swrap_bind_symbol_all();
+ swrap_inject_o_largefile(&flags);
+
if (flags & O_CREAT) {
mode = va_arg(ap, int);
}
swrap_bind_symbol_all();
+ swrap_inject_o_largefile(&flags);
+
if (flags & O_CREAT) {
mode = va_arg(ap, int);
}
swrap_bind_symbol_all();
+ swrap_inject_o_largefile(&flags);
+
if (flags & O_CREAT) {
mode = va_arg(ap, int);
}
struct cmsghdr *cmsg;
};
-static int swrap_sendmsg_unix_scm_rights(const struct cmsghdr *cmsg,
+static int swrap_sendmsg_unix_scm_rights(struct cmsghdr *cmsg,
uint8_t **cm_data,
size_t *cm_data_space,
int *scm_rights_pipe_fd)
return 0;
}
-static int swrap_sendmsg_unix_sol_socket(const struct cmsghdr *cmsg,
+static int swrap_sendmsg_unix_sol_socket(struct cmsghdr *cmsg,
uint8_t **cm_data,
size_t *cm_data_space,
int *scm_rights_pipe_fd)
return rc;
}
-static int swrap_recvmsg_unix_scm_rights(const struct cmsghdr *cmsg,
+static int swrap_recvmsg_unix_scm_rights(struct cmsghdr *cmsg,
uint8_t **cm_data,
size_t *cm_data_space)
{
return 0;
}
-static int swrap_recvmsg_unix_sol_socket(const struct cmsghdr *cmsg,
+static int swrap_recvmsg_unix_sol_socket(struct cmsghdr *cmsg,
uint8_t **cm_data,
size_t *cm_data_space)
{
SAFE_FREE(sockets);
- if (swrap.libc.handle != NULL) {
+ if (swrap.libc.handle != NULL
+#ifdef RTLD_NEXT
+ && swrap.libc.handle != RTLD_NEXT
+#endif
+ ) {
dlclose(swrap.libc.handle);
}
- if (swrap.libc.socket_handle) {
+ if (swrap.libc.socket_handle
+#ifdef RTLD_NEXT
+ && swrap.libc.socket_handle != RTLD_NEXT
+#endif
+ ) {
dlclose(swrap.libc.socket_handle);
}
}