Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/common/kevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ kevent_dump(const struct kevent *kev)

snprintf((char *) buf, sizeof(buf),
"{ ident=%i, filter=%s, %s, %s, data=%d, udata=%p }",
(u_int) kev->ident,
(unsigned int) kev->ident,
kevent_filter_dump(kev),
kevent_flags_dump(kev),
kevent_fflags_dump(kev),
Expand Down
6 changes: 4 additions & 2 deletions src/common/kqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,23 @@ get_fd_limit(void)
unsigned int
get_fd_used(void)
{
#ifdef __linux__
unsigned int fd_max = get_fd_limit();
unsigned int i;
unsigned int used = 0;
int our_errno = errno; /* Preserve errno */

#ifdef __linux__
for (i = 0; i < fd_max; i++) {
if (fcntl(i, F_GETFD) == 0)
used++;
}
#endif

errno = our_errno;

return used;
#else
return 0;
#endif
}

static struct map *kqmap;
Expand Down
8 changes: 8 additions & 0 deletions src/solaris/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,23 @@
#ifndef _KQUEUE_SOLARIS_PLATFORM_H
#define _KQUEUE_SOLARIS_PLATFORM_H

struct filter;

#include <errno.h>
#include <pthread.h>
#include <signal.h>
#include <stdatomic.h>
#include <string.h>
#include <stropts.h>
#include <sys/poll.h>
#include <sys/queue.h>
#include <sys/resource.h>
#include <sys/time.h>

#include "../posix/eventfd.h"
#include "../posix/platform_ext.h"

#define EVENTFD_PLATFORM_SPECIFIC POSIX_EVENTFD_PLATFORM_SPECIFIC

/*
* C11 atomic operations
Expand Down
2 changes: 1 addition & 1 deletion src/solaris/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ signal_handler(int sig)

s = &sigtbl[sig];
dbg_printf("sig=%d %d", sig, s->st_signum);
atomic_inc((volatile uint32_t *) &s->st_count);
(void)atomic_inc((volatile uint32_t *) &s->st_count);
port_send(s->st_port, X_PORT_SOURCE_SIGNAL, &sigtbl[sig]);
/* TODO: crash if port_send() fails? */
}
Expand Down
2 changes: 1 addition & 1 deletion src/solaris/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int
evfilt_user_knote_create(struct filter *filt UNUSED, struct knote *kn UNUSED)
{
#if TODO
u_int ffctrl;
unsigned int ffctrl;

//determine if EV_ADD + NOTE_TRIGGER in the same kevent will cause a trigger */
if ((!(dst->kev.flags & EV_DISABLE)) && src->fflags & NOTE_TRIGGER) {
Expand Down