<commit_before>#include "first.h"

#include "fdevent_impl.h"
#include "fdevent.h"
#include "buffer.h"
#include "log.h"

#include <sys/types.h>

#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>

#ifdef FDEVENT_USE_SOLARIS_PORT

static const int SOLARIS_PORT_POLL_READ       = POLLIN;
static const int SOLARIS_PORT_POLL_WRITE      = POLLOUT;
static const int SOLARIS_PORT_POLL_READ_WRITE = POLLIN & POLLOUT;

static int fdevent_solaris_port_event_del(fdevents *ev, int fde_ndx, int fd) {
	if (fde_ndx < 0) return -1;

	if (0 != port_dissociate(ev->port_fd, PORT_SOURCE_FD, fd)) {
		log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
			"port_dissociate failed: ", strerror(errno), ", dying");

		SEGFAULT();<commit_msg>[core] add include sys/poll.h on Solaris (fixes #2859)<commit_after>#include "first.h"

#include "fdevent_impl.h"
#include "fdevent.h"
#include "buffer.h"
#include "log.h"

#include <sys/types.h>

#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>

#ifdef FDEVENT_USE_SOLARIS_PORT

#include <sys/poll.h>
static const int SOLARIS_PORT_POLL_READ       = POLLIN;
static const int SOLARIS_PORT_POLL_WRITE      = POLLOUT;
static const int SOLARIS_PORT_POLL_READ_WRITE = POLLIN & POLLOUT;

static int fdevent_solaris_port_event_del(fdevents *ev, int fde_ndx, int fd) {
	if (fde_ndx < 0) return -1;

	if (0 != port_dissociate(ev->port_fd, PORT_SOURCE_FD, fd)) {
		log_error_write(ev->srv, __FILE__, __LINE__, "SSS",
			"port_dissociate failed: ", strerror(errno), ", dying");

		SEGFAULT();
{'fraction_non_alphanumeric': 0.13525360050093926, 'fraction_numerical': 0.006261740763932373, 'mean_word_length': 5.341269841269841, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1177008', 'n_tokens_mistral': 698, 'n_tokens_neox': 663, 'n_words': 142}