context.c revision 15a44745412679c30a6d022733925af70a38b715
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Copyright (C) 2000 Internet Software Consortium.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Permission to use, copy, modify, and distribute this software for any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * purpose with or without fee is hereby granted, provided that the above
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * copyright notice and this permission notice appear in all copies.
35f6a21f5f8114542c050bfcb484b39ce513d4bdEvan Hunt * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
35f6a21f5f8114542c050bfcb484b39ce513d4bdEvan Hunt * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
e676a596869d8a80a644c99a848afb53d1c5975eMark Andrews * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
e676a596869d8a80a644c99a848afb53d1c5975eMark Andrews * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
e676a596869d8a80a644c99a848afb53d1c5975eMark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
e676a596869d8a80a644c99a848afb53d1c5975eMark Andrews * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
35f6a21f5f8114542c050bfcb484b39ce513d4bdEvan Hunt * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
/* $Id: context.c,v 1.27 2000/07/27 09:53:35 tale Exp $ */
#include <config.h>
#include <fcntl.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "context_p.h"
#include "assert_p.h"
#ifndef LWRES_SOCKADDR_LEN_T
#define LWRES_SOCKADDR_LEN_T unsigned int
static lwres_result_t
unsigned int flags)
return (LWRES_R_NOMEMORY);
* Init resolv.conf bits.
return (LWRES_R_SUCCESS);
void *mem;
return (NULL);
return (mem);
static lwres_result_t
int ret;
return (LWRES_R_IOERROR);
if (ret != 0) {
close(s);
return (LWRES_R_IOERROR);
return (LWRES_R_SUCCESS);
int *recvd_len)
int ret;
int ret2;
if (ret < 0)
return (LWRES_R_IOERROR);
return (LWRES_R_IOERROR);
if (ret2 < 0)
return (LWRES_R_IOERROR);
if (ret2 == 0)
return (LWRES_R_TIMEOUT);
if (ret < 0)
return (LWRES_R_IOERROR);
goto again;
return (LWRES_R_SUCCESS);