3 * - complex test harness, routines used for both record and playback
6 * This file is part of adns, which is Copyright (C) 1997, 1998 Ian Jackson
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2, or (at your option)
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software Foundation,
20 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 void Qgettimeofday(void) {
29 Tsyscall("gettimeofday()");
32 void Qselect(int n, fd_set rfds, fd_set wfds, fd_set efds, const struct timeval *t) {
35 sprintf(buf,"select(%d, [",n);
44 sprintf(buf,"], %ld.%06ld)",t->tv_sec,t->tv_usec);
53 void Qsocket(int type) {
55 case SOCK_STREAM: Tsyscall("socket(,SOCK_STREAM,)"); break;
56 case SOCK_DGRAM: Tsyscall("socket(,SOCK_DGRAM,)"); break;
61 void Qfcntl(int fd, int cmd, long arg) {
66 sprintf(buf,"fcntl(%d, %s, %ld)",
69 void Qconnect(int fd, struct sockaddr *addr, int addrlen);
72 void Qsendto(int fd, const void *msg, int msglen, unsigned int flags,
73 const struct sockaddr *addr, int addrlen);
74 void Qrecvfrom(int fd, int buflen, unsigned int flags, int *addrlen);
76 void Qread(int fd, size_t len);
77 void Qwrite(int fd, const void *buf, size_t len);