ObjFW  Diff

Differences From Artifact [8827a4d942]:

To Artifact [1e1bf29b71]:


26
27
28
29
30
31
32

33
34
35
36
37
38
39
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40







+







#include <sys/time.h>

#import "OFStreamObserver_kqueue.h"
#import "OFDataArray.h"

#import "OFInitializationFailedException.h"
#import "OFOutOfMemoryException.h"
#import "OFOutOfRangeException.h"

#import "autorelease.h"
#import "macros.h"

#define EVENTLIST_SIZE 64

@implementation OFStreamObserver_kqueue
66
67
68
69
70
71
72



73
74
75
76
77
78
79
80



81
82
83
84
85
86
87
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94







+
+
+








+
+
+







	[super dealloc];
}

- (void)OF_addFileDescriptorForReading: (int)fd
{
	struct kevent event;

	if ([changeList count] >= INT_MAX)
		@throw [OFOutOfRangeException exceptionWithClass: [self class]];

	EV_SET(&event, fd, EVFILT_READ, EV_ADD, 0, 0, 0);
	[changeList addItem: &event];
}

- (void)OF_addFileDescriptorForWriting: (int)fd
{
	struct kevent event;

	if ([changeList count] >= INT_MAX)
		@throw [OFOutOfRangeException exceptionWithClass: [self class]];

	EV_SET(&event, fd, EVFILT_WRITE, EV_ADD, 0, 0, 0);
	[changeList addItem: &event];
}

- (void)OF_removeFileDescriptorForReading: (int)fd
{
	struct kevent event;