cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Segmentation fault in curl_easy_cleanup() [AIX]

From: <cml932atom_at_sulusea.org>
Date: Tue, 22 Oct 2002 11:08:07 -0400

On Sun, Oct 20, 2002 at 03:26:21PM +0200, Daniel Stenberg wrote:
> > "memdebug.h", line 67.9: 1506-213 (S) Macro name accept cannot be
> > redefined.
> > "memdebug.h", line 67.9: 1506-358 (I) "accept" is defined on line
> > 127 of /usr/include/sys/socket.h.
> > make: 1254-004 The error code from the last command is 1.
>
> This seems to happen because accept() is already a macro, so we
> can't redefine the define like this.
>
> We could avoid the warning/error by using "#undef accept" first, but
> then I bet we'll face some other problems.
>
> What exactly is accept defined to on line 127 of
> /usr/include/sys/socket.h ?

If the following quotes from sys/socket.h aren't enough, then I will
send you the entire file offlist. Thanks.

---QUOTE sys/socket.h START---

$ grep -n accept /usr/include/sys/socket.h

85:extern "C" int naccept(int, struct sockaddr *, socklen_t *);
90:inline int accept(int socketfd, struct sockaddr *address, socklen_t *address_len)
92: return naccept(socketfd, address, address_len);
127:#define accept naccept
384:int accept();
405:int accept(int, struct sockaddr *, socklen_t *);

$ for ln in `grep -n accept /usr/include/sys/socket.h | cut -d ":" -f
1`; do echo "socket.h:$ln ($(($ln-3))-$(($ln+3)))"; head -$((ln+3))
/usr/include/sys/socket.h | tail -7; printf "\n\n"; done

socket.h:85 (82-88)
 */
#ifndef _KERNEL
#ifdef __cplusplus
extern "C" int naccept(int, struct sockaddr *, socklen_t *);
extern "C" int ngetpeername(int, struct sockaddr *, socklen_t *);
extern "C" int ngetsockname(int, struct sockaddr *, socklen_t *);
extern "C" ssize_t nrecvfrom(int, void *, size_t, int, struct sockaddr *,

socket.h:90 (87-93)
extern "C" int ngetsockname(int, struct sockaddr *, socklen_t *);
extern "C" ssize_t nrecvfrom(int, void *, size_t, int, struct sockaddr *,
                             socklen_t *);
inline int accept(int socketfd, struct sockaddr *address, socklen_t *address_len)
{
        return naccept(socketfd, address, address_len);
}

socket.h:92 (89-95)
                             socklen_t *);
inline int accept(int socketfd, struct sockaddr *address, socklen_t *address_len)
{
        return naccept(socketfd, address, address_len);
}
inline int getpeername(int socketfd, struct sockaddr *address,
                       socklen_t *address_len)

socket.h:127 (124-130)
#endif /* COMPAT_43 */
#else /* __cplusplus */
#define recvfrom nrecvfrom
#define accept naccept
#define getpeername ngetpeername
#define getsockname ngetsockname

socket.h:384 (381-387)

#ifdef _NO_PROTO

int accept();
int bind();
int connect();
int getpeername();

socket.h:405 (402-408)
#else

#if !defined(_ALL_SOURCE) || defined(_KERNEL) || !defined(__cplusplus)
int accept(int, struct sockaddr *, socklen_t *);
int getpeername(int, struct sockaddr *, socklen_t *);
int getsockname(int, struct sockaddr *, socklen_t *);
ssize_t recvfrom(int, void *, size_t, int, struct sockaddr *, socklen_t *);

---QUOTE sys/socket.h END---

-------------------------------------------------------
This sf.net emial is sponsored by: Influence the future
of Java(TM) technology. Join the Java Community
Process(SM) (JCP(SM)) program now.
http://ad.doubleclick.net/clk;4699841;7576301;v?http://www.sun.com/javavote
Received on 2002-10-22