imapext-2007
diff src/osdep/unix/os_sv2.c @ 0:ada5e610ab86
imap-2007e
author | yuuji@gentei.org |
---|---|
date | Mon, 14 Sep 2009 15:17:45 +0900 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/osdep/unix/os_sv2.c Mon Sep 14 15:17:45 2009 +0900 1.3 @@ -0,0 +1,128 @@ 1.4 +/* ======================================================================== 1.5 + * Copyright 1988-2006 University of Washington 1.6 + * 1.7 + * Licensed under the Apache License, Version 2.0 (the "License"); 1.8 + * you may not use this file except in compliance with the License. 1.9 + * You may obtain a copy of the License at 1.10 + * 1.11 + * http://www.apache.org/licenses/LICENSE-2.0 1.12 + * 1.13 + * 1.14 + * ======================================================================== 1.15 + */ 1.16 + 1.17 +/* 1.18 + * Program: Operating-system dependent routines -- SVR2 version 1.19 + * 1.20 + * Author: Mark Crispin 1.21 + * Networks and Distributed Computing 1.22 + * Computing & Communications 1.23 + * University of Washington 1.24 + * Administration Building, AG-44 1.25 + * Seattle, WA 98195 1.26 + * Internet: MRC@CAC.Washington.EDU 1.27 + * 1.28 + * Date: 10 April 1992 1.29 + * Last Edited: 30 August 2006 1.30 + */ 1.31 + 1.32 +#include "tcp_unix.h" /* must be before osdep includes tcp.h */ 1.33 +#include "mail.h" 1.34 +#include "osdep.h" 1.35 +#include <ctype.h> 1.36 +#include <stdio.h> 1.37 +#include <sys/stat.h> 1.38 +#include <netinet/in.h> 1.39 +#include <arpa/inet.h> 1.40 +#include <netdb.h> 1.41 +#include <errno.h> 1.42 +extern int errno; 1.43 +#include <pwd.h> 1.44 +#include <sys/socket.h> 1.45 +#include <time.h> 1.46 +#define KERNEL 1.47 +#include <sys/time.h> 1.48 +#undef KERNEL 1.49 +#include "misc.h" 1.50 + 1.51 +#define DIR_SIZE(d) sizeof (DIR) 1.52 + 1.53 +extern int sys_nerr; 1.54 +extern char *sys_errlist[]; 1.55 + 1.56 +#define toint(c) ((c)-'0') 1.57 +#define isodigit(c) (((unsigned)(c)>=060)&((unsigned)(c)<=067)) 1.58 + 1.59 +#define NBBY 8 /* number of bits in a byte */ 1.60 +#define FD_SETSIZE 256 1.61 + 1.62 +typedef long fd_mask; 1.63 +#define NFDBITS (sizeof(fd_mask) * NBBY) 1.64 + /* bits per mask */ 1.65 +#define howmany(x, y) (((x)+((y)-1))/(y)) 1.66 + 1.67 +typedef struct fd_set { 1.68 + fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; 1.69 +} fd_set; 1.70 + 1.71 +#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= \ 1.72 + (1 << ((n) % NFDBITS))) 1.73 +#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= \ 1.74 + ~(1 << ((n) % NFDBITS))) 1.75 +#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & \ 1.76 + (1 << ((n) % NFDBITS))) 1.77 +#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) 1.78 + 1.79 + 1.80 +#include "fs_unix.c" 1.81 +#include "ftl_unix.c" 1.82 +#include "nl_unix.c" 1.83 +#include "env_unix.c" 1.84 +#include "tcp_unix.c" 1.85 +#include "gr_wait.c" 1.86 +#include "flocksim.c" 1.87 +#include "opendir.c" 1.88 +#include "scandir.c" 1.89 +#include "memmove2.c" 1.90 +#include "strstr.c" 1.91 +#include "strerror.c" 1.92 +#include "strtoul.c" 1.93 +#include "tz_sv4.c" 1.94 +#include "gethstid.c" 1.95 +#include "fsync.c" 1.96 +#undef setpgrp 1.97 +#include "setpgrp.c" 1.98 + 1.99 +/* Emulator for BSD syslog() routine 1.100 + * Accepts: priority 1.101 + * message 1.102 + * parameters 1.103 + */ 1.104 + 1.105 +int syslog (int priority,char *message,char *parameters) 1.106 +{ 1.107 + /* nothing here for now */ 1.108 +} 1.109 + 1.110 + 1.111 +/* Emulator for BSD openlog() routine 1.112 + * Accepts: identity 1.113 + * options 1.114 + * facility 1.115 + */ 1.116 + 1.117 +int openlog (char *ident,int logopt,int facility) 1.118 +{ 1.119 + /* nothing here for now */ 1.120 +} 1.121 + 1.122 + 1.123 +/* Emulator for BSD ftruncate() routine 1.124 + * Accepts: file descriptor 1.125 + * length 1.126 + */ 1.127 + 1.128 +int ftruncate (int fd,unsigned long length) 1.129 +{ 1.130 + return -1; /* gotta figure out how to do this */ 1.131 +}