summaryrefslogtreecommitdiffstats
path: root/innbbsd/port.c
blob: 8962ea14b4b20c17b12c3c5da5e1ea3c0d40fef5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "innbbsconf.h"

#ifdef NO_getdtablesize
#include <sys/time.h>
#include <sys/resource.h>
getdtablesize()
{
    struct rlimit   limit;
    if (getrlimit(RLIMIT_NOFILE, &limit) >= 0) {
    return limit.rlim_cur;
    }
    return -1;
}
#endif

#if defined(SYSV) && !defined(WITH_RECORD_O)
#include <fcntl.h>
flock(fd, op)
    int             fd, op;
{
    switch (op) {
    case LOCK_EX:
    op = F_LOCK;
    break;
    case LOCK_UN:
    op = F_ULOCK;
    break;
    default:
    return -1;
    }
    return lockf(fd, op, 0L);
}
#endif