#include <string.h>
#include <ctype.h>
#include <netinet/in.h>
+#include <arpa/inet.h>
#include <bits/uClibc_uintmaxtostr.h>
#ifdef L_inet_aton
* leading 0 -> octal
* all else -> decimal
*/
+libc_hidden_proto(inet_aton)
int inet_aton(const char *cp, struct in_addr *addrptr)
{
in_addr_t addr;
return 1;
}
-libc_hidden_proto(inet_aton)
libc_hidden_def(inet_aton)
#endif
#include <arpa/inet.h>
libc_hidden_proto(inet_aton)
+libc_hidden_proto(inet_addr)
in_addr_t inet_addr(const char *cp)
{
struct in_addr a;
else
return a.s_addr;
}
-libc_hidden_proto(inet_addr)
libc_hidden_def(inet_addr)
#endif
#define INET_NTOA_MAX_LEN 16 /* max 12 digits + 3 '.'s + 1 nul */
+extern char *inet_ntoa_r(struct in_addr in, char buf[INET_NTOA_MAX_LEN]);
+libc_hidden_proto(inet_ntoa_r)
char *inet_ntoa_r(struct in_addr in, char buf[INET_NTOA_MAX_LEN])
{
in_addr_t addr = ntohl(in.s_addr);
return p+1;
}
-libc_hidden_proto(inet_ntoa_r)
libc_hidden_def(inet_ntoa_r)
+libc_hidden_proto(inet_ntoa)
char *inet_ntoa(struct in_addr in)
{
static char buf[INET_NTOA_MAX_LEN];
return(inet_ntoa_r(in, buf));
}
-libc_hidden_proto(inet_ntoa)
libc_hidden_def(inet_ntoa)
#endif
* Formulate an Internet address from network + host. Used in
* building addresses stored in the ifnet structure.
*/
+libc_hidden_proto(inet_makeaddr)
struct in_addr inet_makeaddr(in_addr_t net, in_addr_t host)
{
in_addr_t addr;
addr = htonl(addr);
return (*(struct in_addr *)&addr);
}
-libc_hidden_proto(inet_makeaddr)
libc_hidden_def(inet_makeaddr)
#endif
* Return the network number from an internet
* address; handles class a/b/c network #'s.
*/
+libc_hidden_proto(inet_netof)
in_addr_t
inet_netof(struct in_addr in)
{
else
return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT);
}
-libc_hidden_proto(inet_netof)
libc_hidden_def(inet_netof)
#endif
{ PF_UNSPEC, NULL }
};
+libc_hidden_proto(freeaddrinfo)
void
freeaddrinfo (struct addrinfo *ai)
{
free (p);
}
}
-libc_hidden_proto(freeaddrinfo)
libc_hidden_def(freeaddrinfo)
+libc_hidden_proto(getaddrinfo)
int
getaddrinfo (const char *name, const char *service,
const struct addrinfo *hints, struct addrinfo **pai)
return last_i ? -(last_i & GAIH_EAI) : EAI_NONAME;
}
-libc_hidden_proto(getaddrinfo)
libc_hidden_def(getaddrinfo)
int _net_stayopen attribute_hidden;
+libc_hidden_proto(setnetent)
void setnetent(int f)
{
LOCK;
UNLOCK;
return;
}
-libc_hidden_proto(setnetent)
libc_hidden_def(setnetent)
+libc_hidden_proto(endnetent)
void endnetent(void)
{
LOCK;
_net_stayopen = 0;
UNLOCK;
}
-libc_hidden_proto(endnetent)
libc_hidden_def(endnetent)
static char * any(register char *cp, char *match)
return ((char *)0);
}
+libc_hidden_proto(getnetent)
struct netent *getnetent(void)
{
char *p;
UNLOCK;
return (&net);
}
-libc_hidden_proto(getnetent)
libc_hidden_def(getnetent)
}
}
+libc_hidden_proto(setprotoent)
void setprotoent(int f)
{
LOCK;
proto_stayopen |= f;
UNLOCK;
}
-libc_hidden_proto(setprotoent)
libc_hidden_def(setprotoent)
+libc_hidden_proto(endprotoent)
void endprotoent(void)
{
LOCK;
proto_stayopen = 0;
UNLOCK;
}
-libc_hidden_proto(endprotoent)
libc_hidden_def(endprotoent)
+libc_hidden_proto(getprotoent_r)
int getprotoent_r(struct protoent *result_buf,
char *buf, size_t buflen,
struct protoent **result)
UNLOCK;
return 0;
}
-libc_hidden_proto(getprotoent_r)
libc_hidden_def(getprotoent_r)
struct protoent * getprotoent(void)
}
+libc_hidden_proto(getprotobyname_r)
int getprotobyname_r(const char *name,
struct protoent *result_buf,
char *buf, size_t buflen,
UNLOCK;
return *result?0:ret;
}
-libc_hidden_proto(getprotobyname_r)
libc_hidden_def(getprotobyname_r)
}
+libc_hidden_proto(getprotobynumber_r)
int getprotobynumber_r (int proto_num,
struct protoent *result_buf,
char *buf, size_t buflen,
UNLOCK;
return *result?0:ret;
}
-libc_hidden_proto(getprotobynumber_r)
libc_hidden_def(getprotobynumber_r)
struct protoent * getprotobynumber(int proto_num)
}
}
+libc_hidden_proto(setservent)
void setservent(int f)
{
LOCK;
serv_stayopen |= f;
UNLOCK;
}
-libc_hidden_proto(setservent)
libc_hidden_def(setservent)
+libc_hidden_proto(endservent)
void endservent(void)
{
LOCK;
serv_stayopen = 0;
UNLOCK;
}
-libc_hidden_proto(endservent)
libc_hidden_def(endservent)
+libc_hidden_proto(getservent_r)
int getservent_r(struct servent * result_buf,
char * buf, size_t buflen,
struct servent ** result)
UNLOCK;
return 0;
}
-libc_hidden_proto(getservent_r)
libc_hidden_def(getservent_r)
struct servent * getservent(void)
return result;
}
+libc_hidden_proto(getservbyname_r)
int getservbyname_r(const char *name, const char *proto,
struct servent * result_buf, char * buf, size_t buflen,
struct servent ** result)
UNLOCK;
return *result?0:ret;
}
-libc_hidden_proto(getservbyname_r)
libc_hidden_def(getservbyname_r)
struct servent *getservbyname(const char *name, const char *proto)
}
+libc_hidden_proto(getservbyport_r)
int getservbyport_r(int port, const char *proto,
struct servent * result_buf, char * buf,
size_t buflen, struct servent ** result)
UNLOCK;
return *result?0:ret;
}
-libc_hidden_proto(getservbyport_r)
libc_hidden_def(getservbyport_r)
+libc_hidden_proto(getservbyport)
struct servent * getservbyport(int port, const char *proto)
{
struct servent *result;
getservbyport_r(port, proto, &serv, servbuf, SBUFSIZE, &result);
return result;
}
-libc_hidden_proto(getservbyport)
libc_hidden_def(getservbyport)
/*
* herror -- print the error indicated by the h_errno value.
*/
+libc_hidden_proto(herror)
void herror(const char *s)
{
static const char colon_space[] = ": ";
}
fprintf(stderr, "%s%s%s\n", s, c, p);
}
-libc_hidden_proto(herror)
libc_hidden_def(herror)
extern int __opensock(void) attribute_hidden;
+libc_hidden_proto(if_nametoindex)
unsigned int
if_nametoindex(const char* ifname)
{
return ifr.ifr_ifindex;
#endif
}
-libc_hidden_proto(if_nametoindex)
libc_hidden_def(if_nametoindex)
+libc_hidden_proto(if_freenameindex)
void
if_freenameindex (struct if_nameindex *ifn)
{
}
free (ifn);
}
-libc_hidden_proto(if_freenameindex)
libc_hidden_def(if_freenameindex)
+libc_hidden_proto(if_nameindex)
#if !__ASSUME_NETLINK_SUPPORT
struct if_nameindex *
if_nameindex (void)
return idx;
}
#endif
-libc_hidden_proto(if_nameindex)
libc_hidden_def(if_nameindex)
#if 0
#include <features.h>
#include <ctype.h>
#include <netinet/in.h>
+#include <arpa/inet.h>
/*
* Internet network address interpretation routine.
* The library routines call this routine to interpret
* network numbers.
*/
+libc_hidden_proto(inet_network)
in_addr_t
inet_network(const char *cp)
{
}
return (val);
}
-libc_hidden_proto(inet_network)
libc_hidden_def(inet_network)
* author:
* Paul Vixie, 1996.
*/
+libc_hidden_proto(inet_ntop)
const char *
inet_ntop(int af, const void *src, char *dst, socklen_t size)
{
}
/* NOTREACHED */
}
-libc_hidden_proto(inet_ntop)
libc_hidden_def(inet_ntop)
* author:
* Paul Vixie, 1996.
*/
+libc_hidden_proto(inet_pton)
int
inet_pton(int af, const char *src, void *dst)
{
}
/* NOTREACHED */
}
-libc_hidden_proto(inet_pton)
libc_hidden_def(inet_pton)
# define min(x,y) (((x) > (y)) ? (y) : (x))
#endif /* min */
+libc_hidden_proto(getnameinfo)
int getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
socklen_t hostlen, char *serv, socklen_t servlen,
unsigned int flags)
errno = serrno;
return 0;
}
-libc_hidden_proto(getnameinfo)
libc_hidden_def(getnameinfo)
#endif
static struct authnone_private_s *authnone_private;
#endif
+libc_hidden_proto(authnone_create)
AUTH *
authnone_create (void)
{
}
return (&ap->no_client);
}
-libc_hidden_proto(authnone_create)
libc_hidden_def(authnone_create)
/*ARGSUSED */
* Create a unix style authenticator.
* Returns an auth handle with the given stuff in it.
*/
+libc_hidden_proto(authunix_create)
AUTH *
authunix_create (char *machname, uid_t uid, gid_t gid, int len,
gid_t *aup_gids)
marshal_new_auth (auth);
return auth;
}
-libc_hidden_proto(authunix_create)
libc_hidden_def(authunix_create)
/*
* Returns an auth handle with parameters determined by doing lots of
* syscalls.
*/
+libc_hidden_proto(authunix_create_default)
AUTH *
authunix_create_default (void)
{
free (gids);
return ret_auth;
}
-libc_hidden_proto(authunix_create_default)
libc_hidden_def(authunix_create_default)
/*
* XDR for unix authentication parameters.
* Unfortunately, none of these can be declared const.
*/
+libc_hidden_proto(xdr_authunix_parms)
bool_t
xdr_authunix_parms (XDR * xdrs, struct authunix_parms *p)
{
}
return FALSE;
}
-libc_hidden_proto(xdr_authunix_parms)
libc_hidden_def(xdr_authunix_parms)
/*
* Bind a socket to a privileged IP port
*/
+libc_hidden_proto(bindresvport)
int
bindresvport (int sd, struct sockaddr_in *sin)
{
return res;
}
-libc_hidden_proto(bindresvport)
libc_hidden_def(bindresvport)
/*
* This interface for use by clntrpc
*/
+libc_hidden_proto(clnt_sperrno)
char *
clnt_sperrno (enum clnt_stat stat)
{
}
return _("RPC: (unknown error code)");
}
-libc_hidden_proto(clnt_sperrno)
libc_hidden_def(clnt_sperrno)
void
/*
* Print reply error info
*/
+libc_hidden_proto(clnt_sperror)
char *
clnt_sperror (CLIENT * rpch, const char *msg)
{
*++str = '\0';
return (strstart);
}
-libc_hidden_proto(clnt_sperror)
libc_hidden_def(clnt_sperror)
+libc_hidden_proto(clnt_perror)
void
clnt_perror (CLIENT * rpch, const char *msg)
{
#endif
(void) fputs (clnt_sperror (rpch, msg), stderr);
}
-libc_hidden_proto(clnt_perror)
libc_hidden_def(clnt_perror)
+libc_hidden_proto(clnt_spcreateerror)
char *
clnt_spcreateerror (const char *msg)
{
*++cp = '\0';
return str;
}
-libc_hidden_proto(clnt_spcreateerror)
libc_hidden_def(clnt_spcreateerror)
void
* NB: The rpch->cl_auth is set null authentication. Caller may wish to set this
* something more useful.
*/
+libc_hidden_proto(clnttcp_create)
CLIENT *
clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers,
int *sockp, u_int sendsz, u_int recvsz)
mem_free ((caddr_t) h, sizeof (CLIENT));
return ((CLIENT *) NULL);
}
-libc_hidden_proto(clnttcp_create)
libc_hidden_def(clnttcp_create)
static enum clnt_stat
* sendsz and recvsz are the maximum allowable packet sizes that can be
* sent and received.
*/
+libc_hidden_proto(clntudp_bufcreate)
CLIENT *
clntudp_bufcreate (struct sockaddr_in *raddr, u_long program, u_long version,
struct timeval wait, int *sockp, u_int sendsz,
mem_free ((caddr_t) cl, sizeof (CLIENT));
return (CLIENT *) NULL;
}
-libc_hidden_proto(clntudp_bufcreate)
libc_hidden_def(clntudp_bufcreate)
+libc_hidden_proto(clntudp_create)
CLIENT *
clntudp_create (struct sockaddr_in *raddr, u_long program, u_long version, struct timeval wait, int *sockp)
{
return clntudp_bufcreate (raddr, program, version, wait, sockp,
UDPMSGSIZE, UDPMSGSIZE);
}
-libc_hidden_proto(clntudp_create)
libc_hidden_def(clntudp_create)
static int
* NB: The rpch->cl_auth is set null authentication. Caller may wish to set this
* something more useful.
*/
+libc_hidden_proto(clntunix_create)
CLIENT *
clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers,
int *sockp, u_int sendsz, u_int recvsz)
mem_free ((caddr_t) h, sizeof (CLIENT));
return (CLIENT *) NULL;
}
-libc_hidden_proto(clntunix_create)
libc_hidden_def(clntunix_create)
static enum clnt_stat
return d;
}
+libc_hidden_proto(endrpcent)
void endrpcent(void)
{
register struct rpcdata *d = _rpcdata();
d->rpcf = NULL;
}
}
-libc_hidden_proto(endrpcent)
libc_hidden_def(endrpcent)
+libc_hidden_proto(setrpcent)
void setrpcent(int f)
{
register struct rpcdata *d = _rpcdata();
d->current = NULL;
d->stayopen |= f;
}
-libc_hidden_proto(setrpcent)
libc_hidden_def(setrpcent)
static struct rpcent *interpret(struct rpcdata *);
return interpret(d);
}
+libc_hidden_proto(getrpcent)
struct rpcent *getrpcent(void)
{
register struct rpcdata *d = _rpcdata();
return NULL;
return __get_next_rpcent(d);
}
-libc_hidden_proto(getrpcent)
libc_hidden_def(getrpcent)
+libc_hidden_proto(getrpcbynumber)
struct rpcent *getrpcbynumber(register int number)
{
register struct rpcdata *d = _rpcdata();
endrpcent();
return rpc;
}
-libc_hidden_proto(getrpcbynumber)
libc_hidden_def(getrpcbynumber)
+libc_hidden_proto(getrpcbyname)
struct rpcent *getrpcbyname(const char *name)
{
struct rpcent *rpc;
endrpcent();
return NULL;
}
-libc_hidden_proto(getrpcbyname)
libc_hidden_def(getrpcbyname)
#ifdef __linux__
* Set a mapping between program,version and port.
* Calls the pmap service remotely to do the mapping.
*/
+libc_hidden_proto(pmap_set)
bool_t
pmap_set (u_long program, u_long version, int protocol, u_short port)
{
/* (void)close(socket); CLNT_DESTROY closes it */
return rslt;
}
-libc_hidden_proto(pmap_set)
libc_hidden_def(pmap_set)
/*
* Remove the mapping between program,version and port.
* Calls the pmap service remotely to do the un-mapping.
*/
+libc_hidden_proto(pmap_unset)
bool_t
pmap_unset (u_long program, u_long version)
{
/* (void)close(socket); CLNT_DESTROY already closed it */
return rslt;
}
-libc_hidden_proto(pmap_unset)
libc_hidden_def(pmap_unset)
* Calls the pmap service remotely to do the lookup.
* Returns 0 if no map exists.
*/
+libc_hidden_proto(pmap_getport)
u_short
pmap_getport (struct sockaddr_in *address, u_long program, u_long version, u_int protocol)
{
address->sin_port = 0;
return port;
}
-libc_hidden_proto(pmap_getport)
libc_hidden_def(pmap_getport)
* XDR remote call arguments
* written for XDR_ENCODE direction only
*/
+libc_hidden_proto(xdr_rmtcall_args)
bool_t
xdr_rmtcall_args (XDR *xdrs, struct rmtcallargs *cap)
{
}
return FALSE;
}
-libc_hidden_proto(xdr_rmtcall_args)
libc_hidden_def(xdr_rmtcall_args)
/*
extern int ruserpass(const char *host, const char **aname, const char **apass) attribute_hidden;
libc_hidden_proto(ruserpass)
+libc_hidden_proto(rexec_af)
int
rexec_af(char **ahost, int rport, const char *name, const char *pass, const char *cmd, int *fd2p, sa_family_t af)
{
freeaddrinfo(res0);
return (-1);
}
-libc_hidden_proto(rexec_af)
libc_hidden_def(rexec_af)
int
/*
* XDR a call message
*/
+libc_hidden_proto(xdr_callmsg)
bool_t
xdr_callmsg (XDR *xdrs, struct rpc_msg *cmsg)
{
return xdr_opaque_auth (xdrs, &(cmsg->rm_call.cb_verf));
return FALSE;
}
-libc_hidden_proto(xdr_callmsg)
libc_hidden_def(xdr_callmsg)
* Cache the result of getdtablesize(), so we don't have to do an
* expensive system call every time.
*/
+libc_hidden_proto(_rpc_dtablesize)
int
_rpc_dtablesize(void)
{
return size;
}
-libc_hidden_proto(_rpc_dtablesize)
libc_hidden_def(_rpc_dtablesize)
* XDR an opaque authentication struct
* (see auth.h)
*/
+libc_hidden_proto(xdr_opaque_auth)
bool_t
xdr_opaque_auth (XDR *xdrs, struct opaque_auth *ap)
{
&ap->oa_length, MAX_AUTH_BYTES);
return FALSE;
}
-libc_hidden_proto(xdr_opaque_auth)
libc_hidden_def(xdr_opaque_auth)
/*
/*
* XDR the MSG_ACCEPTED part of a reply message union
*/
+extern bool_t xdr_accepted_reply (XDR *xdrs, struct accepted_reply *ar);
+libc_hidden_proto(xdr_accepted_reply)
bool_t
xdr_accepted_reply (XDR *xdrs, struct accepted_reply *ar)
{
}
return TRUE; /* TRUE => open ended set of problems */
}
-libc_hidden_proto(xdr_accepted_reply)
libc_hidden_def(xdr_accepted_reply)
/*
* XDR the MSG_DENIED part of a reply message union
*/
+extern bool_t xdr_rejected_reply (XDR *xdrs, struct rejected_reply *rr);
+libc_hidden_proto(xdr_rejected_reply)
bool_t
xdr_rejected_reply (XDR *xdrs, struct rejected_reply *rr)
{
}
return FALSE;
}
-libc_hidden_proto(xdr_rejected_reply)
libc_hidden_def(xdr_rejected_reply)
static const struct xdr_discrim reply_dscrm[3] =
/*
* XDR a reply message
*/
+libc_hidden_proto(xdr_replymsg)
bool_t
xdr_replymsg (XDR *xdrs, struct rpc_msg *rmsg)
{
NULL_xdrproc_t);
return FALSE;
}
-libc_hidden_proto(xdr_replymsg)
libc_hidden_def(xdr_replymsg)
* The fields include: rm_xid, rm_direction, rpcvers, prog, and vers.
* The rm_xid is not really static, but the user can easily munge on the fly.
*/
+libc_hidden_proto(xdr_callhdr)
bool_t
xdr_callhdr (XDR *xdrs, struct rpc_msg *cmsg)
{
return xdr_u_long (xdrs, &(cmsg->rm_call.cb_vers));
return FALSE;
}
-libc_hidden_proto(xdr_callhdr)
libc_hidden_def(xdr_callhdr)
/* ************************** Client utility routine ************* */
/*
* given a reply message, fills in the error
*/
+libc_hidden_proto(_seterr_reply)
void
_seterr_reply (struct rpc_msg *msg,
struct rpc_err *error)
break;
}
}
-libc_hidden_proto(_seterr_reply)
libc_hidden_def(_seterr_reply)
#include <assert.h>
#include "rpc_private.h"
+libc_hidden_proto(__rpc_thread_svc_fdset)
+libc_hidden_proto(__rpc_thread_createerr)
+libc_hidden_proto(__rpc_thread_svc_pollfd)
+libc_hidden_proto(__rpc_thread_svc_max_pollfd)
+
#ifdef __UCLIBC_HAS_THREADS__
#include <bits/libc-tsd.h>
#endif /* __UCLIBC_HAS_THREADS__ */
-libc_hidden_proto(__rpc_thread_svc_fdset)
libc_hidden_def(__rpc_thread_svc_fdset)
-libc_hidden_proto(__rpc_thread_createerr)
libc_hidden_def(__rpc_thread_createerr)
-libc_hidden_proto(__rpc_thread_svc_pollfd)
libc_hidden_def(__rpc_thread_svc_pollfd)
-libc_hidden_proto(__rpc_thread_svc_max_pollfd)
libc_hidden_def(__rpc_thread_svc_max_pollfd)
+extern int ruserpass(const char *host, const char **aname, const char **apass);
+libc_hidden_proto(ruserpass)
int ruserpass(const char *host, const char **aname, const char **apass)
{
char *hdir, *buf, *tmp;
(void) fclose(cfile);
return (-1);
}
-libc_hidden_proto(ruserpass)
libc_hidden_def(ruserpass)
static int
/* *************** SVCXPRT related stuff **************** */
/* Activate a transport handle. */
+libc_hidden_proto(xprt_register)
void
xprt_register (SVCXPRT *xprt)
{
POLLRDNORM | POLLRDBAND);
}
}
-libc_hidden_proto(xprt_register)
libc_hidden_def(xprt_register)
/* De-activate a transport handle. */
+libc_hidden_proto(xprt_unregister)
void
xprt_unregister (SVCXPRT *xprt)
{
svc_pollfd[i].fd = -1;
}
}
-libc_hidden_proto(xprt_unregister)
libc_hidden_def(xprt_unregister)
/* Add a service program to the callout list.
The dispatch routine will be called when a rpc request for this
program number comes in. */
+libc_hidden_proto(svc_register)
bool_t
svc_register (SVCXPRT * xprt, rpcprog_t prog, rpcvers_t vers,
void (*dispatch) (struct svc_req *, SVCXPRT *),
return TRUE;
}
-libc_hidden_proto(svc_register)
libc_hidden_def(svc_register)
/* Remove a service program from the callout list. */
+libc_hidden_proto(svc_unregister)
void
svc_unregister (rpcprog_t prog, rpcvers_t vers)
{
/* now unregister the information with the local binder service */
pmap_unset (prog, vers);
}
-libc_hidden_proto(svc_unregister)
libc_hidden_def(svc_unregister)
/* ******************* REPLY GENERATION ROUTINES ************ */
/* Send a reply to an rpc request */
+libc_hidden_proto(svc_sendreply)
bool_t
svc_sendreply (register SVCXPRT *xprt, xdrproc_t xdr_results,
caddr_t xdr_location)
rply.acpted_rply.ar_results.proc = xdr_results;
return SVC_REPLY (xprt, &rply);
}
-libc_hidden_proto(svc_sendreply)
libc_hidden_def(svc_sendreply)
/* No procedure error reply */
}
/* Can't decode args error reply */
+libc_hidden_proto(svcerr_decode)
void
svcerr_decode (register SVCXPRT *xprt)
{
rply.acpted_rply.ar_stat = GARBAGE_ARGS;
SVC_REPLY (xprt, &rply);
}
-libc_hidden_proto(svcerr_decode)
libc_hidden_def(svcerr_decode)
/* Some system error */
}
/* Authentication error reply */
+libc_hidden_proto(svcerr_auth)
void
svcerr_auth (SVCXPRT *xprt, enum auth_stat why)
{
rply.rjcted_rply.rj_why = why;
SVC_REPLY (xprt, &rply);
}
-libc_hidden_proto(svcerr_auth)
libc_hidden_def(svcerr_auth)
/* Auth too weak error reply */
}
/* Program unavailable error reply */
+libc_hidden_proto(svcerr_noprog)
void
svcerr_noprog (register SVCXPRT *xprt)
{
rply.acpted_rply.ar_stat = PROG_UNAVAIL;
SVC_REPLY (xprt, &rply);
}
-libc_hidden_proto(svcerr_noprog)
libc_hidden_def(svcerr_noprog)
/* Program version mismatch error reply */
+libc_hidden_proto(svcerr_progvers)
void
svcerr_progvers (register SVCXPRT *xprt, rpcvers_t low_vers,
rpcvers_t high_vers)
rply.acpted_rply.ar_vers.high = high_vers;
SVC_REPLY (xprt, &rply);
}
-libc_hidden_proto(svcerr_progvers)
libc_hidden_def(svcerr_progvers)
/* ******************* SERVER INPUT STUFF ******************* */
* is mallocated in kernel land.
*/
+libc_hidden_proto(svc_getreq_common)
void
svc_getreq_common (const int fd)
{
}
while (stat == XPRT_MOREREQS);
}
-libc_hidden_proto(svc_getreq_common)
libc_hidden_def(svc_getreq_common)
+libc_hidden_proto(svc_getreqset)
void
svc_getreqset (fd_set *readfds)
{
for (mask = *maskp++; (bit = ffs (mask)); mask ^= (1 << (bit - 1)))
svc_getreq_common (sock + bit - 1);
}
-libc_hidden_proto(svc_getreqset)
libc_hidden_def(svc_getreqset)
+libc_hidden_proto(svc_getreq)
void
svc_getreq (int rdfds)
{
readfds.fds_bits[0] = rdfds;
svc_getreqset (&readfds);
}
-libc_hidden_proto(svc_getreq)
libc_hidden_def(svc_getreq)
+libc_hidden_proto(svc_getreq_poll)
void
svc_getreq_poll (struct pollfd *pfdp, int pollretval)
{
}
}
}
-libc_hidden_proto(svc_getreq_poll)
libc_hidden_def(svc_getreq_poll)
#ifdef __UCLIBC_HAS_THREADS__
* There is an assumption that any flavour less than AUTH_NULL is
* invalid.
*/
+libc_hidden_proto(_authenticate)
enum auth_stat
_authenticate (register struct svc_req *rqst, struct rpc_msg *msg)
{
return AUTH_REJECTEDCRED;
}
-libc_hidden_proto(_authenticate)
libc_hidden_def(_authenticate)
static enum auth_stat
* see (svc.h, xprt_register).
* The routines returns NULL if a problem occurred.
*/
+libc_hidden_proto(svcudp_bufcreate)
SVCXPRT *
svcudp_bufcreate (int sock, u_int sendsz, u_int recvsz)
{
xprt_register (xprt);
return xprt;
}
-libc_hidden_proto(svcudp_bufcreate)
libc_hidden_def(svcudp_bufcreate)
+libc_hidden_proto(svcudp_create)
SVCXPRT *
svcudp_create (int sock)
{
return svcudp_bufcreate (sock, UDPMSGSIZE, UDPMSGSIZE);
}
-libc_hidden_proto(svcudp_create)
libc_hidden_def(svcudp_create)
static enum xprt_stat
* The definition of xdr_long() is kept for backward
* compatibility. Instead xdr_int() should be used.
*/
+libc_hidden_proto(xdr_long)
bool_t
xdr_long (XDR *xdrs, long *lp)
{
return FALSE;
}
-libc_hidden_proto(xdr_long)
libc_hidden_def(xdr_long)
/*
* XDR short integers
*/
+libc_hidden_proto(xdr_short)
bool_t
xdr_short (XDR *xdrs, short *sp)
{
}
return FALSE;
}
-libc_hidden_proto(xdr_short)
libc_hidden_def(xdr_short)
/*
* XDR integers
*/
+libc_hidden_proto(xdr_int)
bool_t
xdr_int (XDR *xdrs, int *ip)
{
#error unexpected integer sizes in xdr_int()
#endif
}
-libc_hidden_proto(xdr_int)
libc_hidden_def(xdr_int)
/*
* The definition of xdr_u_long() is kept for backward
* compatibility. Instead xdr_u_int() should be used.
*/
+libc_hidden_proto(xdr_u_long)
bool_t
xdr_u_long (XDR *xdrs, u_long *ulp)
{
}
return FALSE;
}
-libc_hidden_proto(xdr_u_long)
libc_hidden_def(xdr_u_long)
/*
* XDR unsigned integers
*/
+libc_hidden_proto(xdr_u_int)
bool_t
xdr_u_int (XDR *xdrs, u_int *up)
{
#error unexpected integer sizes in xdr_u_int()
#endif
}
-libc_hidden_proto(xdr_u_int)
libc_hidden_def(xdr_u_int)
/*
* XDR hyper integers
* same as xdr_u_hyper - open coded to save a proc call!
*/
+libc_hidden_proto(xdr_hyper)
bool_t
xdr_hyper (XDR *xdrs, quad_t *llp)
{
return FALSE;
}
-libc_hidden_proto(xdr_hyper)
libc_hidden_def(xdr_hyper)
* XDR hyper integers
* same as xdr_hyper - open coded to save a proc call!
*/
+libc_hidden_proto(xdr_u_hyper)
bool_t
xdr_u_hyper (XDR *xdrs, u_quad_t *ullp)
{
return FALSE;
}
-libc_hidden_proto(xdr_u_hyper)
libc_hidden_def(xdr_u_hyper)
bool_t
/*
* XDR booleans
*/
+libc_hidden_proto(xdr_bool)
bool_t
xdr_bool (XDR *xdrs, bool_t *bp)
{
}
return FALSE;
}
-libc_hidden_proto(xdr_bool)
libc_hidden_def(xdr_bool)
/*
* XDR enumerations
*/
+libc_hidden_proto(xdr_enum)
bool_t
xdr_enum (XDR *xdrs, enum_t *ep)
{
return FALSE;
}
}
-libc_hidden_proto(xdr_enum)
libc_hidden_def(xdr_enum)
/*
* Allows the specification of a fixed size sequence of opaque bytes.
* cp points to the opaque object and cnt gives the byte length.
*/
+libc_hidden_proto(xdr_opaque)
bool_t
xdr_opaque (XDR *xdrs, caddr_t cp, u_int cnt)
{
}
return FALSE;
}
-libc_hidden_proto(xdr_opaque)
libc_hidden_def(xdr_opaque)
/*
* *cpp is a pointer to the bytes, *sizep is the count.
* If *cpp is NULL maxsize bytes are allocated
*/
+libc_hidden_proto(xdr_bytes)
bool_t
xdr_bytes (XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
{
}
return FALSE;
}
-libc_hidden_proto(xdr_bytes)
libc_hidden_def(xdr_bytes)
/*
* routine may be called.
* If there is no specific or default routine an error is returned.
*/
+libc_hidden_proto(xdr_union)
bool_t
xdr_union (XDR *xdrs, enum_t *dscmp, char *unp, const struct xdr_discrim *choices, xdrproc_t dfault)
{
return ((dfault == NULL_xdrproc_t) ? FALSE :
(*dfault) (xdrs, unp, LASTUNSIGNED));
}
-libc_hidden_proto(xdr_union)
libc_hidden_def(xdr_union)
/*
* storage is allocated. The last parameter is the max allowed length
* of the string as specified by a protocol.
*/
+libc_hidden_proto(xdr_string)
bool_t
xdr_string (XDR *xdrs, char **cpp, u_int maxsize)
{
}
return FALSE;
}
-libc_hidden_proto(xdr_string)
libc_hidden_def(xdr_string)
/*
* elsize is the size (in bytes) of each element, and elproc is the
* xdr procedure to call to handle each element of the array.
*/
+libc_hidden_proto(xdr_array)
bool_t
xdr_array (XDR *xdrs, caddr_t *addrp, u_int *sizep, u_int maxsize, u_int elsize, xdrproc_t elproc)
{
}
return stat;
}
-libc_hidden_proto(xdr_array)
libc_hidden_def(xdr_array)
/*
* The procedure xdrmem_create initializes a stream descriptor for a
* memory buffer.
*/
+libc_hidden_proto(xdrmem_create)
void
xdrmem_create (XDR *xdrs, const caddr_t addr, u_int size, enum xdr_op op)
{
xdrs->x_private = xdrs->x_base = addr;
xdrs->x_handy = size;
}
-libc_hidden_proto(xdrmem_create)
libc_hidden_def(xdrmem_create)
/*
* write respectively. They are like the system
* calls expect that they take an opaque handle rather than an fd.
*/
+libc_hidden_proto(xdrrec_create)
void
xdrrec_create (XDR *xdrs, u_int sendsize,
u_int recvsize, caddr_t tcp_handle,
rstrm->fbtbc = 0;
rstrm->last_frag = TRUE;
}
-libc_hidden_proto(xdrrec_create)
libc_hidden_def(xdrrec_create)
* Before reading (deserializing from the stream, one should always call
* this procedure to guarantee proper record alignment.
*/
+libc_hidden_proto(xdrrec_skiprecord)
bool_t
xdrrec_skiprecord (XDR *xdrs)
{
rstrm->last_frag = FALSE;
return TRUE;
}
-libc_hidden_proto(xdrrec_skiprecord)
libc_hidden_def(xdrrec_skiprecord)
/*
* Returns TRUE iff there is no more input in the buffer
* after consuming the rest of the current record.
*/
+libc_hidden_proto(xdrrec_eof)
bool_t
xdrrec_eof (XDR *xdrs)
{
return TRUE;
return FALSE;
}
-libc_hidden_proto(xdrrec_eof)
libc_hidden_def(xdrrec_eof)
/*
* (output) tcp stream. (This lets the package support batched or
* pipelined procedure calls.) TRUE => immediate flush to tcp connection.
*/
+libc_hidden_proto(xdrrec_endofrecord)
bool_t
xdrrec_endofrecord (XDR *xdrs, bool_t sendnow)
{
rstrm->out_finger += BYTES_PER_XDR_UNIT;
return TRUE;
}
-libc_hidden_proto(xdrrec_endofrecord)
libc_hidden_def(xdrrec_endofrecord)
/*
* size is the size of the referneced structure.
* proc is the routine to handle the referenced structure.
*/
+libc_hidden_proto(xdr_reference)
bool_t
xdr_reference (XDR *xdrs, caddr_t *pp, u_int size, xdrproc_t proc)
{
}
return stat;
}
-libc_hidden_proto(xdr_reference)
libc_hidden_def(xdr_reference)
/*
#endif
#ifdef L_bind
+libc_hidden_proto(bind)
#ifdef __NR_bind
_syscall3(int, bind, int, sockfd, const struct sockaddr *, myaddr, socklen_t, addrlen);
#elif defined(__NR_socketcall)
return __socketcall(SYS_BIND, args);
}
#endif
-libc_hidden_proto(bind)
libc_hidden_def(bind)
#endif
#endif
#ifdef L_getsockname
+libc_hidden_proto(getsockname)
#ifdef __NR_getsockname
_syscall3(int, getsockname, int, sockfd, struct sockaddr *, addr, socklen_t *,paddrlen);
#elif defined(__NR_socketcall)
return __socketcall(SYS_GETSOCKNAME, args);
}
#endif
-libc_hidden_proto(getsockname)
libc_hidden_def(getsockname)
#endif
#endif
#ifdef L_listen
+libc_hidden_proto(listen)
#ifdef __NR_listen
_syscall2(int, listen, int, sockfd, int, backlog);
#elif defined(__NR_socketcall)
return __socketcall(SYS_LISTEN, args);
}
#endif
-libc_hidden_proto(listen)
libc_hidden_def(listen)
#endif
#endif
#ifdef L_setsockopt
+libc_hidden_proto(setsockopt)
#ifdef __NR_setsockopt
_syscall5(int, setsockopt, int, fd, int, level, int, optname, const void *, optval, socklen_t, optlen);
#elif defined(__NR_socketcall)
return (__socketcall(SYS_SETSOCKOPT, args));
}
#endif
-libc_hidden_proto(setsockopt)
libc_hidden_def(setsockopt)
#endif
#endif
#ifdef L_socket
+libc_hidden_proto(socket)
#ifdef __NR_socket
_syscall3(int, socket, int, family, int, type, int, protocol);
#elif defined(__NR_socketcall)
return __socketcall(SYS_SOCKET, args);
}
#endif
-libc_hidden_proto(socket)
libc_hidden_def(socket)
#endif
#ifdef L_tolower
#undef tolower
+libc_hidden_proto(tolower)
#ifdef __UCLIBC_HAS_CTYPE_TABLES__
int tolower(int c)
}
#endif /* __UCLIBC_HAS_CTYPE_TABLES__ */
-libc_hidden_proto(tolower)
libc_hidden_def(tolower)
#endif
#ifdef L_tolower_l
#undef tolower_l
+libc_hidden_proto(tolower_l)
int tolower_l(int c, __locale_t l)
{
#if defined(__UCLIBC_HAS_CTYPE_ENFORCED__)
#endif
return __UCLIBC_CTYPE_IN_TO_DOMAIN(c) ? l->__ctype_tolower[c] : c;
}
-libc_hidden_proto(tolower_l)
libc_hidden_def(tolower_l)
#endif
#ifdef L_toupper
#undef toupper
+libc_hidden_proto(toupper)
#ifdef __UCLIBC_HAS_CTYPE_TABLES__
int toupper(int c)
}
#endif /* __UCLIBC_HAS_CTYPE_TABLES__ */
-libc_hidden_proto(toupper)
libc_hidden_def(toupper)
#endif
#ifdef L_toupper_l
#undef toupper_l
+libc_hidden_proto(toupper_l)
int toupper_l(int c, __locale_t l)
{
#if defined(__UCLIBC_HAS_CTYPE_ENFORCED__)
#endif
return __UCLIBC_CTYPE_IN_TO_DOMAIN(c) ? l->__ctype_toupper[c] : c;
}
-
-libc_hidden_proto(toupper_l)
libc_hidden_def(toupper_l)
#endif
#include <errno.h>
#include "dirstream.h"
+libc_hidden_proto(dirfd)
+
int dirfd(DIR * dir)
{
if (!dir || dir->dd_fd == -1) {
return dir->dd_fd;
}
-libc_hidden_proto(dirfd)
libc_hidden_def(dirfd)
weak_alias(__environ, environ)
/* TODO: don't export __pagesize; we cant now because libpthread uses it */
-size_t __pagesize = 0;
+extern size_t __pagesize;
libc_hidden_proto(__pagesize)
+size_t __pagesize = 0;
libc_hidden_def(__pagesize)
#ifndef O_NOFOLLOW
* __uClibc_main.
*/
+extern void __uClibc_init(void);
+libc_hidden_proto(__uClibc_init)
void __uClibc_init(void)
{
static int been_there_done_that = 0;
_stdio_init();
}
-libc_hidden_proto(__uClibc_init)
libc_hidden_def(__uClibc_init)
#ifdef __UCLIBC_CTOR_DTOR__
']', '\x00', '^', '[', 'n', 'N', ']', '\x00',
};
+libc_hidden_proto(nl_langinfo)
char *nl_langinfo(nl_item item)
{
unsigned int c;
}
return (char *) cat_start; /* Conveniently, this is the empty string. */
}
-libc_hidden_proto(nl_langinfo)
libc_hidden_def(nl_langinfo)
#else /* __LOCALE_C_ONLY */
#if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE)
+libc_hidden_proto(nl_langinfo)
+
libc_hidden_proto(nl_langinfo_l)
char *nl_langinfo(nl_item item)
{
return nl_langinfo_l(item, __UCLIBC_CURLOCALE);
}
-libc_hidden_proto(nl_langinfo)
libc_hidden_def(nl_langinfo)
#else /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
+libc_hidden_proto(__XL_NPP(nl_langinfo))
+
static const char empty[] = "";
char *__XL_NPP(nl_langinfo)(nl_item item __LOCALE_PARAM )
return (char *) empty;
}
-libc_hidden_proto(__XL_NPP(nl_langinfo))
libc_hidden_def(__XL_NPP(nl_langinfo))
#endif /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
/**********************************************************************/
#ifdef L_newlocale
+libc_hidden_proto(newlocale)
+
#ifdef __UCLIBC_MJN3_ONLY__
#warning TODO: Move posix and utf8 strings.
#endif
return base;
}
-libc_hidden_proto(newlocale)
libc_hidden_def(newlocale)
#endif
/**********************************************************************/
#ifdef L_duplocale
+libc_hidden_proto(duplocale)
+
#ifdef __UCLIBC_MJN3_ONLY__
#warning REMINDER: When we allocate ctype tables, remember to dup them.
#endif
}
return r;
}
-libc_hidden_proto(duplocale)
libc_hidden_def(duplocale)
#endif
/**********************************************************************/
#ifdef L_uselocale
+libc_hidden_proto(uselocale)
+
__locale_t uselocale(__locale_t dataset)
{
__locale_t old;
}
return old;
}
-libc_hidden_proto(uselocale)
libc_hidden_def(uselocale)
#endif
#include <string.h>
#include <mntent.h>
+libc_hidden_proto(getmntent_r)
+libc_hidden_proto(setmntent)
+libc_hidden_proto(endmntent)
+
libc_hidden_proto(strstr)
libc_hidden_proto(strtok_r)
libc_hidden_proto(atoi)
return mnt;
}
-libc_hidden_proto(getmntent_r)
libc_hidden_def(getmntent_r)
struct mntent *getmntent(FILE * filep)
{
return fopen(name, mode);
}
-libc_hidden_proto(setmntent)
libc_hidden_def(setmntent)
int endmntent(FILE * filep)
fclose(filep);
return 1;
}
-libc_hidden_proto(endmntent)
libc_hidden_def(endmntent)
#include <search.h>
+libc_hidden_proto(hcreate_r)
+libc_hidden_proto(hdestroy_r)
+libc_hidden_proto(hsearch_r)
+
/* [Aho,Sethi,Ullman] Compilers: Principles, Techniques and Tools, 1986
[Knuth] The Art of Computer Programming, part 3 (6.4) */
/* everything went alright */
return 1;
}
-libc_hidden_proto(hcreate_r)
libc_hidden_def(hcreate_r)
#endif
/* the sign for an existing table is an value != NULL in htable */
htab->table = NULL;
}
-libc_hidden_proto(hdestroy_r)
libc_hidden_def(hdestroy_r)
#endif
*retval = NULL;
return 0;
}
-libc_hidden_proto(hsearch_r)
libc_hidden_def(hsearch_r)
#endif
#include <search.h>
#include <stdlib.h>
+libc_hidden_proto(tsearch)
+libc_hidden_proto(tfind)
+libc_hidden_proto(tdestroy)
+
/* This routine is not very bad. It makes many assumptions about
* the compiler. It assumpts that the first field in node must be
* the "key" field, which points to the datum. It is a very trick
}
return (q);
}
-libc_hidden_proto(tsearch)
libc_hidden_def(tsearch)
#endif
}
return NULL;
}
-libc_hidden_proto(tfind)
libc_hidden_def(tfind)
#endif
tdestroy_recurse (root, freefct);
}
}
-libc_hidden_proto(tdestroy)
libc_hidden_def(tdestroy)
#endif
#include <sys/statvfs.h>
#include <stddef.h>
+libc_hidden_proto(fstatfs64)
+
libc_hidden_proto(memcpy)
libc_hidden_proto(fstatfs)
return 0;
}
-libc_hidden_proto(fstatfs64)
libc_hidden_def(fstatfs64)
#include <stddef.h>
#include <sys/statfs.h>
+libc_hidden_proto(statfs64)
+
libc_hidden_proto(memcpy)
libc_hidden_proto(statfs)
return 0;
}
-libc_hidden_proto(statfs64)
libc_hidden_def(statfs64)
#include <xlocale.h>
#endif
+libc_hidden_proto(asctime)
+libc_hidden_proto(asctime_r)
+libc_hidden_proto(ctime)
+libc_hidden_proto(localtime)
+libc_hidden_proto(localtime_r)
+
libc_hidden_proto(memset)
libc_hidden_proto(memcpy)
libc_hidden_proto(strcmp)
/**********************************************************************/
#ifdef L_asctime
-libc_hidden_proto(asctime_r)
-
static char __time_str[26];
char *asctime(const struct tm *ptm)
{
return asctime_r(ptm, __time_str);
}
-libc_hidden_proto(asctime)
libc_hidden_def(asctime)
#endif
return buffer - 8;
}
-libc_hidden_proto(asctime_r)
libc_hidden_def(asctime_r)
#endif
/**********************************************************************/
#ifdef L_ctime
-libc_hidden_proto(asctime)
-libc_hidden_proto(localtime)
-
char *ctime(const time_t *clock)
{
/* ANSI/ISO/SUSv3 say that ctime is equivalent to the following. */
return asctime(localtime(clock));
}
-libc_hidden_proto(ctime)
libc_hidden_def(ctime)
#endif
/**********************************************************************/
#ifdef L_ctime_r
-libc_hidden_proto(asctime_r)
-libc_hidden_proto(localtime_r)
-
char *ctime_r(const time_t *clock, char *buf)
{
struct tm xtm;
/**********************************************************************/
#ifdef L_localtime
-libc_hidden_proto(localtime_r)
-
struct tm *localtime(const time_t *timer)
{
register struct tm *ptm = &__time_tm;
return ptm;
}
-libc_hidden_proto(localtime)
libc_hidden_def(localtime)
#endif
return result;
}
-libc_hidden_proto(localtime_r)
libc_hidden_def(localtime_r)
#endif
#if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE)
+libc_hidden_proto(strftime)
+
libc_hidden_proto(strftime_l)
size_t strftime(char *__restrict s, size_t maxsize,
{
return strftime_l(s, maxsize, format, timeptr, __UCLIBC_CURLOCALE);
}
-libc_hidden_proto(strftime)
libc_hidden_def(strftime)
#else /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
#warning TODO: Check multibyte format string validity.
#endif
+libc_hidden_proto(__XL_NPP(strftime))
size_t __XL_NPP(strftime)(char *__restrict s, size_t maxsize,
const char *__restrict format,
const struct tm *__restrict timeptr __LOCALE_PARAM )
}
goto LOOP;
}
-libc_hidden_proto(__XL_NPP(strftime))
libc_hidden_def(__XL_NPP(strftime))
#endif /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
#if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE)
+libc_hidden_proto(strptime)
+
libc_hidden_proto(strptime_l)
char *strptime(const char *__restrict buf, const char *__restrict format,
{
return strptime_l(buf, format, tm, __UCLIBC_CURLOCALE);
}
-libc_hidden_proto(strptime)
libc_hidden_def(strptime)
#else /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
#define MAX_PUSH 4
-libc_hidden_proto(localtime_r)
-
+libc_hidden_proto(__XL_NPP(strptime))
char *__XL_NPP(strptime)(const char *__restrict buf, const char *__restrict format,
struct tm *__restrict tm __LOCALE_PARAM)
{
}
return NULL;
}
-libc_hidden_proto(__XL_NPP(strptime))
libc_hidden_def(__XL_NPP(strptime))
#endif /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
#if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE)
+libc_hidden_proto(wcsftime)
+
libc_hidden_proto(wcsftime_l)
size_t wcsftime(wchar_t *__restrict s, size_t maxsize,
{
return wcsftime_l(s, maxsize, format, timeptr, __UCLIBC_CURLOCALE);
}
-libc_hidden_proto(wcsftime)
libc_hidden_def(wcsftime)
#else /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
+libc_hidden_proto(__XL_NPP(wcsftime))
size_t __XL_NPP(wcsftime)(wchar_t *__restrict s, size_t maxsize,
const wchar_t *__restrict format,
const struct tm *__restrict timeptr __LOCALE_PARAM )
#warning wcsftime always fails
return 0; /* always fail */
}
-libc_hidden_proto(__XL_NPP(wcsftime))
libc_hidden_def(__XL_NPP(wcsftime))
#endif /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
libc_hidden_proto(mbrtowc)
+libc_hidden_proto(btowc)
wint_t btowc(int c)
{
#ifdef __CTYPE_HAS_8_BIT_LOCALES
#endif /* __CTYPE_HAS_8_BIT_LOCALES */
}
-libc_hidden_proto(btowc)
libc_hidden_def(btowc)
#endif
/**********************************************************************/
#ifdef L_mbsinit
+libc_hidden_proto(mbsinit)
int mbsinit(const mbstate_t *ps)
{
return !ps || !ps->__mask;
}
-libc_hidden_proto(mbsinit)
libc_hidden_def(mbsinit)
#endif
libc_hidden_proto(mbrtowc)
+libc_hidden_proto(mbrlen)
size_t mbrlen(const char *__restrict s, size_t n, mbstate_t *__restrict ps)
{
static mbstate_t mbstate; /* Rely on bss 0-init. */
return mbrtowc(NULL, s, n, (ps != NULL) ? ps : &mbstate);
}
-libc_hidden_proto(mbrlen)
libc_hidden_def(mbrlen)
#endif
libc_hidden_proto(mbsnrtowcs)
+libc_hidden_proto(mbrtowc)
size_t mbrtowc(wchar_t *__restrict pwc, const char *__restrict s,
size_t n, mbstate_t *__restrict ps)
{
}
return (size_t) r;
}
-libc_hidden_proto(mbrtowc)
libc_hidden_def(mbrtowc)
#endif
/* Note: We completely ignore ps in all currently supported conversions. */
/* TODO: Check for valid state anyway? */
+libc_hidden_proto(wcrtomb)
size_t wcrtomb(register char *__restrict s, wchar_t wc,
mbstate_t *__restrict ps)
{
r = wcsnrtombs(s, &pwc, 1, MB_LEN_MAX, ps);
return (r != 0) ? r : 1;
}
-libc_hidden_proto(wcrtomb)
libc_hidden_def(wcrtomb)
#endif
libc_hidden_proto(mbsnrtowcs)
+libc_hidden_proto(mbsrtowcs)
size_t mbsrtowcs(wchar_t *__restrict dst, const char **__restrict src,
size_t len, mbstate_t *__restrict ps)
{
return mbsnrtowcs(dst, src, SIZE_MAX, len,
((ps != NULL) ? ps : &mbstate));
}
-libc_hidden_proto(mbsrtowcs)
libc_hidden_def(mbsrtowcs)
#endif
libc_hidden_proto(wcsnrtombs)
+libc_hidden_proto(wcsrtombs)
size_t wcsrtombs(char *__restrict dst, const wchar_t **__restrict src,
size_t len, mbstate_t *__restrict ps)
{
return wcsnrtombs(dst, src, SIZE_MAX, len, ps);
}
-libc_hidden_proto(wcsrtombs)
libc_hidden_def(wcsrtombs)
#endif
/* WARNING: We treat len as SIZE_MAX when dst is NULL! */
+libc_hidden_proto(mbsnrtowcs)
size_t mbsnrtowcs(wchar_t *__restrict dst, const char **__restrict src,
size_t NMC, size_t len, mbstate_t *__restrict ps)
{
}
return len - count;
}
-libc_hidden_proto(mbsnrtowcs)
libc_hidden_def(mbsnrtowcs)
#endif
/* Note: We completely ignore ps in all currently supported conversions.
* TODO: Check for valid state anyway? */
+libc_hidden_proto(wcsnrtombs)
size_t wcsnrtombs(char *__restrict dst, const wchar_t **__restrict src,
size_t NWC, size_t len, mbstate_t *__restrict ps)
{
}
return len - count;
}
-libc_hidden_proto(wcsnrtombs)
libc_hidden_def(wcsnrtombs)
#endif
/**********************************************************************/
#ifdef L_wcswidth
+libc_hidden_proto(wcswidth)
+
#ifdef __UCLIBC_MJN3_ONLY__
#warning REMINDER: If we start doing translit, wcwidth and wcswidth will need updating.
#warning TODO: Update wcwidth to match latest by Kuhn.
#endif /* __UCLIBC_HAS_LOCALE__ */
-libc_hidden_proto(wcswidth)
libc_hidden_def(wcswidth)
#endif
#ifdef __UCLIBC_DO_XLOCALE
#define ISW_FUNC_BODY(NAME) \
+libc_hidden_proto(__PASTE3(isw,NAME,_l)); \
int __PASTE3(isw,NAME,_l) (wint_t wc, __locale_t l) \
{ \
return iswctype_l(wc, __PASTE2(_CTYPE_is,NAME), l); \
} \
-libc_hidden_proto(__PASTE3(isw,NAME,_l)); \
libc_hidden_def(__PASTE3(isw,NAME,_l))
#else /* __UCLIBC_DO_XLOCALE */
#define ISW_FUNC_BODY(NAME) \
+libc_hidden_proto(__PASTE2(isw,NAME)); \
int __PASTE2(isw,NAME) (wint_t wc) \
{ \
return iswctype(wc, __PASTE2(_CTYPE_is,NAME)); \
} \
-libc_hidden_proto(__PASTE2(isw,NAME)); \
libc_hidden_def(__PASTE2(isw,NAME))
#endif /* __UCLIBC_DO_XLOCALE */
static const unsigned char typestring[] = __CTYPE_TYPESTRING;
/* extern const unsigned char typestring[]; */
+libc_hidden_proto(wctype)
wctype_t wctype(const char *property)
{
const unsigned char *p;
/* TODO - Add locale-specific classifications. */
return 0;
}
-libc_hidden_proto(wctype)
libc_hidden_def(wctype)
#endif
libc_hidden_proto(wctype)
+libc_hidden_proto(wctype_l)
wctype_t wctype_l (const char *property, __locale_t locale)
{
return wctype(property);
}
-libc_hidden_proto(wctype_l)
libc_hidden_def(wctype_l)
#endif
static const char transstring[] = __CTYPE_TRANSTRING;
+libc_hidden_proto(wctrans)
wctrans_t wctrans(const char *property)
{
const unsigned char *p;
/* TODO - Add locale-specific translations. */
return 0;
}
-libc_hidden_proto(wctrans)
libc_hidden_def(wctrans)
#endif
/**********************************************************************/
#ifdef L_fgetpwent_r
+libc_hidden_proto(fgetpwent_r)
int fgetpwent_r(FILE *__restrict stream, struct passwd *__restrict resultbuf,
char *__restrict buffer, size_t buflen,
struct passwd **__restrict result)
return rv;
}
-libc_hidden_proto(fgetpwent_r)
libc_hidden_def(fgetpwent_r)
#endif
/**********************************************************************/
#ifdef L_fgetgrent_r
+libc_hidden_proto(fgetgrent_r)
int fgetgrent_r(FILE *__restrict stream, struct group *__restrict resultbuf,
char *__restrict buffer, size_t buflen,
struct group **__restrict result)
return rv;
}
-libc_hidden_proto(fgetgrent_r)
libc_hidden_def(fgetgrent_r)
#endif
/**********************************************************************/
#ifdef L_fgetspent_r
+libc_hidden_proto(fgetspent_r)
int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,
char *__restrict buffer, size_t buflen,
struct spwd **__restrict result)
return rv;
}
-libc_hidden_proto(fgetspent_r)
libc_hidden_def(fgetspent_r)
#endif
/**********************************************************************/
#ifdef L_sgetspent_r
+libc_hidden_proto(sgetspent_r)
int sgetspent_r(const char *string, struct spwd *result_buf,
char *buffer, size_t buflen, struct spwd **result)
{
DONE:
return rv;
}
-libc_hidden_proto(sgetspent_r)
libc_hidden_def(sgetspent_r)
#endif
}
+libc_hidden_proto(getpwent_r)
int getpwent_r(struct passwd *__restrict resultbuf,
char *__restrict buffer, size_t buflen,
struct passwd **__restrict result)
return rv;
}
-libc_hidden_proto(getpwent_r)
+libc_hidden_def(getpwent_r)
#endif
/**********************************************************************/
UNLOCK;
}
+libc_hidden_proto(getgrent_r)
int getgrent_r(struct group *__restrict resultbuf,
char *__restrict buffer, size_t buflen,
struct group **__restrict result)
return rv;
}
-libc_hidden_proto(getgrent_r)
libc_hidden_def(getgrent_r)
#endif
UNLOCK;
}
+libc_hidden_proto(getspent_r)
int getspent_r(struct spwd *resultbuf, char *buffer,
size_t buflen, struct spwd **result)
{
return rv;
}
-libc_hidden_proto(getspent_r)
libc_hidden_def(getspent_r)
#endif
/**********************************************************************/
#ifdef GETXXKEY_R_FUNC
+libc_hidden_proto(GETXXKEY_R_FUNC)
int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key,
GETXXKEY_R_ENTTYPE *__restrict resultbuf,
char *__restrict buffer, size_t buflen,
return rv;
}
-libc_hidden_proto(GETXXKEY_R_FUNC)
libc_hidden_def(GETXXKEY_R_FUNC)
#endif
#include "sigsetops.h"
/* Add SIGNO to SET. */
+libc_hidden_proto(sigaddset)
int
sigaddset (set, signo)
sigset_t *set;
return __sigaddset (set, signo);
}
-libc_hidden_proto(sigaddset)
libc_hidden_def(sigaddset)
#include "sigset-cvt-mask.h"
/* Block signals in MASK, returning the old mask. */
+libc_hidden_proto(sigblock)
int sigblock (int mask)
{
sigset_t set, oset;
return sigset_get_old_mask (&oset);
}
-libc_hidden_proto(sigblock)
libc_hidden_def(sigblock)
#include "sigsetops.h"
/* Add SIGNO to SET. */
+libc_hidden_proto(sigdelset)
int sigdelset (sigset_t *set, int signo)
{
if (set == NULL || signo <= 0 || signo >= NSIG)
return __sigdelset (set, signo);
}
-libc_hidden_proto(sigdelset)
libc_hidden_def(sigdelset)
libc_hidden_proto(memset)
/* Clear all signals from SET. */
+libc_hidden_proto(sigemptyset)
int
sigemptyset (set)
sigset_t *set;
return 0;
}
-libc_hidden_proto(sigemptyset)
libc_hidden_def(sigemptyset)
#include <string.h>
libc_hidden_proto(memset)
-libc_hidden_proto(__sigdelset)
/* Set all signals in SET. */
+libc_hidden_proto(sigfillset)
int
sigfillset (sigset_t *set)
{
return 0;
}
-libc_hidden_proto(sigfillset)
libc_hidden_def(sigfillset)
/* Set the handler for the signal SIG to HANDLER,
returning the old handler, or SIG_ERR on error. */
-__sighandler_t
+attribute_hidden __sighandler_t
__bsd_signal (int sig, __sighandler_t handler)
{
struct sigaction act, oact;
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#define _BSD_SOURCE
#include <errno.h>
#include <signal.h>
#include <stddef.h> /* For NULL. */
/* Set the mask of blocked signals to MASK,
wait for a signal to arrive, and then restore the mask. */
+libc_hidden_proto(__sigpause)
int __sigpause (int sig_or_mask, int is_sig)
{
sigset_t set;
return sigsuspend (&set);
}
-libc_hidden_proto(__sigpause)
libc_hidden_def(__sigpause)
#undef sigpause
/* We have to provide a default version of this function since the
standards demand it. The version which is a bit more reasonable is
the BSD version. So make this the default. */
+libc_hidden_proto(sigpause)
int sigpause (int mask)
{
return __sigpause (mask, 0);
}
-libc_hidden_proto(sigpause)
libc_hidden_def(sigpause)
#include "sigset-cvt-mask.h"
/* Set the mask of blocked signals to MASK, returning the old mask. */
+libc_hidden_proto(sigsetmask)
int
sigsetmask (int mask)
{
return sigset_get_old_mask (&oset);
}
-libc_hidden_proto(sigsetmask)
libc_hidden_def(sigsetmask)
libc_hidden_proto(sigwaitinfo)
+libc_hidden_proto(sigwait)
int sigwait (const sigset_t *set, int *sig)
{
int ret = 1;
}
return 1;
}
-libc_hidden_proto(sigwait)
libc_hidden_def(sigwait)
#include "_stdio.h"
#include <stdio_ext.h>
+libc_hidden_proto(__fsetlocking)
+
/* Not threadsafe. */
/* Notes:
return FSETLOCKING_INTERNAL;
#endif
}
-
-libc_hidden_proto(__fsetlocking)
libc_hidden_def(__fsetlocking)
#include "_stdio.h"
#include <stdarg.h>
+libc_hidden_proto(asprintf)
+
libc_hidden_proto(vasprintf)
#ifndef __STDIO_HAS_VSNPRINTF
return rv;
}
-
-libc_hidden_proto(asprintf)
libc_hidden_def(asprintf)
#endif
*/
#include "_stdio.h"
+libc_hidden_proto(fclose)
libc_hidden_proto(close)
libc_hidden_proto(fflush_unlocked)
return rv;
}
-libc_hidden_proto(fclose)
libc_hidden_def(fclose)
#elif defined __UCLIBC_HAS_THREADS__
+libc_hidden_proto(fflush)
int fflush(register FILE *stream)
{
int retval;
return retval;
}
-libc_hidden_proto(fflush)
libc_hidden_def(fflush)
#endif
#undef getc
#undef getc_unlocked
+libc_hidden_proto(__fgetc_unlocked)
+
#ifdef __DO_UNLOCKED
libc_hidden_proto(fflush_unlocked)
return EOF;
}
-libc_hidden_proto(__fgetc_unlocked)
libc_hidden_def(__fgetc_unlocked)
strong_alias(__fgetc_unlocked,fgetc_unlocked)
#elif defined __UCLIBC_HAS_THREADS__
-libc_hidden_proto(__fgetc_unlocked)
-
+libc_hidden_proto(fgetc)
int fgetc(register FILE *stream)
{
if (stream->__user_locking != 0) {
return retval;
}
}
-libc_hidden_proto(fgetc)
libc_hidden_def(fgetc)
strong_alias(fgetc,getc)
#elif defined __UCLIBC_HAS_THREADS__
+libc_hidden_proto(fgets)
char *fgets(char *__restrict s, int n,
register FILE * __restrict stream)
{
return retval;
}
-libc_hidden_proto(fgets)
libc_hidden_def(fgets)
#endif
#elif defined __UCLIBC_HAS_THREADS__
+libc_hidden_proto(fgetwc)
wint_t fgetwc(register FILE *stream)
{
wint_t retval;
return retval;
}
-libc_hidden_proto(fgetwc)
libc_hidden_def(fgetwc)
strong_alias(fgetwc,getwc)
#elif defined __UCLIBC_HAS_THREADS__
+libc_hidden_proto(fileno)
int fileno(register FILE *stream)
{
int retval;
return retval;
}
-libc_hidden_proto(fileno)
libc_hidden_def(fileno)
#endif
#undef fopen64
#endif
+libc_hidden_proto(fopen)
FILE *fopen(const char * __restrict filename, const char * __restrict mode)
{
return _stdio_fopen(((intptr_t) filename), mode, NULL, FILEDES_ARG);
}
-libc_hidden_proto(fopen)
libc_hidden_def(fopen)
/* Currently no real reentrancy issues other than a possible double close(). */
#ifndef __BCC__
+libc_hidden_proto(fopencookie)
FILE *fopencookie(void * __restrict cookie, const char * __restrict mode,
cookie_io_functions_t io_functions)
#else
return stream;
}
#ifndef __BCC__
-libc_hidden_proto(fopencookie)
libc_hidden_def(fopencookie)
#endif
libc_hidden_proto(vfprintf)
+libc_hidden_proto(fprintf)
int fprintf(FILE * __restrict stream, const char * __restrict format, ...)
{
va_list arg;
return rv;
}
-libc_hidden_proto(fprintf)
libc_hidden_def(fprintf)
#undef putc
#undef putc_unlocked
+libc_hidden_proto(__fputc_unlocked)
+
#ifdef __DO_UNLOCKED
int __fputc_unlocked(int c, register FILE *stream)
BAD:
return EOF;
}
-libc_hidden_proto(__fputc_unlocked)
libc_hidden_def(__fputc_unlocked)
strong_alias(__fputc_unlocked,fputc_unlocked)
#elif defined __UCLIBC_HAS_THREADS__
-libc_hidden_proto(__fputc_unlocked)
-
+libc_hidden_proto(fputc)
int fputc(int c, register FILE *stream)
{
if (stream->__user_locking != 0) {
return retval;
}
}
-libc_hidden_proto(fputc)
libc_hidden_def(fputc)
strong_alias(fputc,putc)
#elif defined __UCLIBC_HAS_THREADS__
+libc_hidden_proto(fputs)
int fputs(const char * __restrict s, register FILE * __restrict stream)
{
int retval;
return retval;
}
-libc_hidden_proto(fputs)
libc_hidden_def(fputs)
#endif
#elif defined __UCLIBC_HAS_THREADS__
+libc_hidden_proto(fputws)
int fputws(const wchar_t *__restrict ws, register FILE *__restrict stream)
{
int retval;
return retval;
}
-libc_hidden_proto(fputws)
libc_hidden_def(fputws)
#endif
#elif defined __UCLIBC_HAS_THREADS__
+libc_hidden_proto(fread)
size_t fread(void * __restrict ptr, size_t size, size_t nmemb,
register FILE * __restrict stream)
{
return retval;
}
-libc_hidden_proto(fread)
libc_hidden_def(fread)
#endif
# define OFFSET_TYPE long int
#endif
-#if defined(__UCLIBC_HAS_LFS__) && !defined(__DO_LARGEFILE)
libc_hidden_proto(fseeko64)
-#endif
+libc_hidden_proto(fseek)
int FSEEK(register FILE *stream, OFFSET_TYPE offset, int whence)
{
}
#ifdef __DO_LARGEFILE
-libc_hidden_proto(fseeko64)
libc_hidden_def(fseeko64)
#else
-libc_hidden_proto(fseek)
libc_hidden_def(fseek)
strong_alias(fseek,fseeko)
#endif
#include "_stdio.h"
-#if defined(__UCLIBC_HAS_LFS__) && !defined(__DO_LARGEFILE)
libc_hidden_proto(ftello64)
-#endif
+libc_hidden_proto(ftell)
#ifndef __DO_LARGEFILE
# define FTELL ftell
}
#ifdef __DO_LARGEFILE
-libc_hidden_proto(ftello64)
libc_hidden_def(ftello64)
#else
-libc_hidden_proto(ftell)
libc_hidden_def(ftell)
strong_alias(ftell,ftello)
#endif
#elif defined __UCLIBC_HAS_THREADS__
+libc_hidden_proto(fwrite)
size_t fwrite(const void * __restrict ptr, size_t size,
size_t nmemb, register FILE * __restrict stream)
{
return retval;
}
-libc_hidden_proto(fwrite)
libc_hidden_def(fwrite)
#endif
#include "_stdio.h"
+libc_hidden_proto(getdelim)
+
libc_hidden_proto(__fgetc_unlocked)
/* Note: There is a defect in this function. (size_t vs ssize_t). */
return pos;
}
-libc_hidden_proto(getdelim)
libc_hidden_def(getdelim)
#include "_stdio.h"
+libc_hidden_proto(getline)
+
libc_hidden_proto(getdelim)
ssize_t getline(char **__restrict lineptr, size_t *__restrict n,
{
return getdelim(lineptr, n, '\n', stream);
}
-libc_hidden_proto(getline)
libc_hidden_def(getline)
* (ie replace the FILE buffer with the cookie buffer and update FILE bufstart,
* etc. whenever we seek). */
+libc_hidden_proto(open_memstream)
FILE *open_memstream(char **__restrict bufloc, size_t *__restrict sizeloc)
{
register __oms_cookie *cookie;
return NULL;
}
-libc_hidden_proto(open_memstream)
libc_hidden_def(open_memstream)
#warning CONSIDER: Increase buffer size for error message (non-%m case)?
#endif
+libc_hidden_proto(perror)
void perror(register const char *s)
{
/* If the program is calling perror, it's a safe bet that printf and
}
#endif
}
-libc_hidden_proto(perror)
libc_hidden_def(perror)
libc_hidden_proto(vfprintf)
+libc_hidden_proto(printf)
int printf(const char * __restrict format, ...)
{
va_list arg;
return rv;
}
-libc_hidden_proto(printf)
libc_hidden_def(printf)
* equivalent to rmdir(path).
*/
+libc_hidden_proto(remove)
int remove(register const char *filename)
{
int saved_errno = errno;
}
return rv;
}
-libc_hidden_proto(remove)
libc_hidden_def(remove)
libc_hidden_proto(fseek)
+libc_hidden_proto(rewind)
void rewind(register FILE *stream)
{
__STDIO_AUTO_THREADLOCK_VAR;
__STDIO_AUTO_THREADUNLOCK(stream);
}
-libc_hidden_proto(rewind)
libc_hidden_def(rewind)
/**********************************************************************/
#ifdef L_fscanf
+libc_hidden_proto(fscanf)
int fscanf(FILE * __restrict stream, const char * __restrict format, ...)
{
va_list arg;
return rv;
}
-libc_hidden_proto(fscanf)
libc_hidden_def(fscanf)
#endif
#ifdef __STDIO_HAS_VSSCANF
+libc_hidden_proto(sscanf)
int sscanf(const char * __restrict str, const char * __restrict format, ...)
{
va_list arg;
return rv;
}
-libc_hidden_proto(sscanf)
libc_hidden_def(sscanf)
#else /* __STDIO_HAS_VSSCANF */
/**********************************************************************/
#ifdef L_vscanf
+libc_hidden_proto(vscanf)
int vscanf(const char * __restrict format, va_list arg)
{
return vfscanf(stdin, format, arg);
}
-libc_hidden_proto(vscanf)
libc_hidden_def(vscanf)
#endif
#error Assumption violated for buffering mode flags
#endif
+libc_hidden_proto(setvbuf)
int setvbuf(register FILE * __restrict stream, register char * __restrict buf,
int mode, size_t size)
{
#endif
}
-libc_hidden_proto(setvbuf)
libc_hidden_def(setvbuf)
libc_hidden_proto(vsnprintf)
+libc_hidden_proto(snprintf)
int snprintf(char *__restrict buf, size_t size,
const char * __restrict format, ...)
{
va_end(arg);
return rv;
}
-libc_hidden_proto(snprintf)
libc_hidden_def(snprintf)
#endif
libc_hidden_proto(vsnprintf)
+libc_hidden_proto(sprintf)
int sprintf(char *__restrict buf, const char * __restrict format, ...)
{
va_list arg;
return rv;
}
-libc_hidden_proto(sprintf)
libc_hidden_def(sprintf)
#endif
* (See section 7.19.6.2 of the C9X rationale -- WG14/N897.)
*/
+libc_hidden_proto(ungetc)
int ungetc(int c, register FILE *stream)
{
__STDIO_AUTO_THREADLOCK_VAR;
return c;
}
-libc_hidden_proto(ungetc)
libc_hidden_def(ungetc)
* as reset stream->__ungot_width[1] for use by _stdio_adjpos().
*/
+libc_hidden_proto(ungetwc)
wint_t ungetwc(wint_t c, register FILE *stream)
{
__STDIO_AUTO_THREADLOCK_VAR;
return c;
}
-libc_hidden_proto(ungetwc)
libc_hidden_def(ungetwc)
libc_hidden_proto(vsnprintf)
#endif
+libc_hidden_proto(vasprintf)
int vasprintf(char **__restrict buf, const char * __restrict format,
va_list arg)
{
#endif /* __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__ */
}
-libc_hidden_proto(vasprintf)
libc_hidden_def(vasprintf)
#endif
libc_hidden_proto(vfprintf)
libc_hidden_proto(fflush_unlocked)
+libc_hidden_proto(vdprintf)
int vdprintf(int filedes, const char * __restrict format, va_list arg)
{
FILE f;
return rv;
}
-libc_hidden_proto(vdprintf)
libc_hidden_def(vdprintf)
libc_hidden_proto(fprintf)
+libc_hidden_proto(VFPRINTF)
int VFPRINTF (FILE * __restrict stream,
register const FMT_TYPE * __restrict format,
va_list arg)
return count;
}
-libc_hidden_proto(VFPRINTF)
libc_hidden_def(VFPRINTF)
#endif
/**********************************************************************/
#include "_stdio.h"
#include <stdarg.h>
+libc_hidden_proto(vsnprintf)
+
libc_hidden_proto(vfprintf)
#ifdef __UCLIBC_MJN3_ONLY__
}
return rv;
}
-libc_hidden_proto(vsnprintf)
libc_hidden_def(vsnprintf)
#elif defined(__USE_OLD_VFPRINTF__)
}
return rv;
}
-libc_hidden_proto(vsnprintf)
libc_hidden_def(vsnprintf)
#elif defined(__UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__)
return rv;
}
-libc_hidden_proto(vsnprintf)
libc_hidden_def(vsnprintf)
#else
#include <stdarg.h>
#include <wchar.h>
+libc_hidden_proto(vswprintf)
+
libc_hidden_proto(vfwprintf)
#ifndef __STDIO_BUFFERS
}
return rv;
}
-libc_hidden_proto(vswprintf)
libc_hidden_def(vswprintf)
#endif /* __STDIO_BUFFERS */
extern int __drand48_iterate(unsigned short xsubi[3],
struct drand48_data *buffer) attribute_hidden;
+libc_hidden_proto(erand48_r)
int erand48_r (unsigned short int xsubi[3], struct drand48_data *buffer, double *result)
{
union ieee754_double temp;
return 0;
}
-libc_hidden_proto(erand48_r)
libc_hidden_def(erand48_r)
extern int __drand48_iterate(unsigned short xsubi[3],
struct drand48_data *buffer) attribute_hidden;
+libc_hidden_proto(jrand48_r)
int jrand48_r (unsigned short int xsubi[3], struct drand48_data *buffer, long int *result)
{
/* Compute next state. */
return 0;
}
-libc_hidden_proto(jrand48_r)
libc_hidden_def(jrand48_r)
libc_hidden_proto(nrand48_r)
+libc_hidden_proto(lrand48_r)
int lrand48_r (struct drand48_data *buffer, long int *result)
{
/* Be generous for the arguments, detect some errors. */
return nrand48_r (buffer->__x, buffer, result);
}
-libc_hidden_proto(lrand48_r)
libc_hidden_def(lrand48_r)
libc_hidden_proto(fprintf)
/* ------------------------------ mallinfo ------------------------------ */
+libc_hidden_proto(mallinfo)
struct mallinfo mallinfo(void)
{
mstate av;
UNLOCK;
return mi;
}
-libc_hidden_proto(mallinfo)
libc_hidden_def(mallinfo)
void malloc_stats(FILE *file)
extern int __drand48_iterate(unsigned short xsubi[3],
struct drand48_data *buffer) attribute_hidden;
+libc_hidden_proto(nrand48_r)
int nrand48_r (unsigned short int xsubi[3], struct drand48_data *buffer, long int *result)
{
/* Compute next state. */
return 0;
}
-libc_hidden_proto(nrand48_r)
libc_hidden_def(nrand48_r)
02111-1307 USA. */
#define _ISOC99_SOURCE
+#define _GNU_SOURCE
#include <stdio.h>
#include <errno.h>
#include <paths.h>
/* Store at most BUFLEN characters of the pathname of the slave pseudo
terminal associated with the master FD is open on in BUF.
Return 0 on success, otherwise an error number. */
+libc_hidden_proto(ptsname_r)
int ptsname_r (int fd, char *buf, size_t buflen)
{
int save_errno = errno;
errno = save_errno;
return 0;
}
-libc_hidden_proto(ptsname_r)
libc_hidden_def(ptsname_r)
/* Return the pathname of the pseudo terminal slave assoicated with
rear pointers can't wrap on the same call by not testing the rear
pointer if the front one has wrapped. Returns a 31-bit random number. */
+libc_hidden_proto(random)
long int random (void)
{
int32_t retval;
__pthread_mutex_unlock(&lock);
return retval;
}
-libc_hidden_proto(random)
libc_hidden_def(random)
rear pointers can't wrap on the same call by not testing the rear
pointer if the front one has wrapped. Returns a 31-bit random number. */
+libc_hidden_proto(random_r)
int random_r(struct random_data *buf, int32_t *result)
{
int32_t *state;
__set_errno (EINVAL);
return -1;
}
-libc_hidden_proto(random_r)
libc_hidden_def(random_r)
/* Initialize the random number generator based on the given seed. If the
information a given number of times to get rid of any initial dependencies
introduced by the L.C.R.N.G. Note that the initialization of randtbl[]
for default usage relies on values produced by this routine. */
+libc_hidden_proto(srandom_r)
int srandom_r (unsigned int seed, struct random_data *buf)
{
int type;
fail:
return -1;
}
-libc_hidden_proto(srandom_r)
libc_hidden_def(srandom_r)
/* Initialize the state information in the given array of N bytes for
Note: The first thing we do is save the current state, if any, just like
setstate so that it doesn't matter when initstate is called.
Returns a pointer to the old state. */
+libc_hidden_proto(initstate_r)
int initstate_r (unsigned int seed, char *arg_state, size_t n, struct random_data *buf)
{
int type;
__set_errno (EINVAL);
return -1;
}
-libc_hidden_proto(initstate_r)
libc_hidden_def(initstate_r)
/* Restore the state from the given state array.
to the order in which things are done, it is OK to call setstate with the
same state as the current state
Returns a pointer to the old state information. */
+libc_hidden_proto(setstate_r)
int setstate_r (char *arg_state, struct random_data *buf)
{
int32_t *new_state = 1 + (int32_t *) arg_state;
__set_errno (EINVAL);
return -1;
}
-libc_hidden_proto(setstate_r)
libc_hidden_def(setstate_r)
libc_hidden_proto(memcpy)
+libc_hidden_proto(seed48_r)
int seed48_r (unsigned short int seed16v[3], struct drand48_data *buffer)
{
/* Save old value at a private place to be used as return value. */
return 0;
}
-libc_hidden_proto(seed48_r)
libc_hidden_def(seed48_r)
return 0;
}
+libc_hidden_proto(setenv)
int setenv (const char *name, const char *value, int replace)
{
return __add_to_environ (name, value, NULL, replace);
}
-libc_hidden_proto(setenv)
libc_hidden_def(setenv)
+libc_hidden_proto(unsetenv)
int unsetenv (const char *name)
{
size_t len;
UNLOCK;
return 0;
}
-libc_hidden_proto(unsetenv)
libc_hidden_def(unsetenv)
/* The `clearenv' was planned to be added to POSIX.1 but probably
#include <stdlib.h>
#include <limits.h>
+libc_hidden_proto(srand48_r)
int srand48_r (long int seedval, struct drand48_data *buffer)
{
/* The standards say we only have 32 bits. */
return 0;
}
-libc_hidden_proto(srand48_r)
libc_hidden_def(srand48_r)
libc_hidden_proto(strtol)
+libc_hidden_proto(atoi)
int atoi(const char *nptr)
{
return (int) strtol(nptr, (char **) NULL, 10);
}
-libc_hidden_proto(atoi)
libc_hidden_def(atoi)
#endif /* INT_MAX < LONG_MAX */
libc_hidden_proto(strtol)
+libc_hidden_proto(atol)
long atol(const char *nptr)
{
return strtol(nptr, (char **) NULL, 10);
}
-libc_hidden_proto(atol)
libc_hidden_def(atol)
#if UINT_MAX == ULONG_MAX
/**********************************************************************/
#if defined(L_strtol) || defined(L_strtol_l)
+libc_hidden_proto(__XL_NPP(strtol))
long __XL_NPP(strtol)(const char * __restrict str, char ** __restrict endptr,
int base __LOCALE_PARAM )
{
return __XL_NPP(_stdlib_strto_l)(str, endptr, base, 1 __LOCALE_ARG );
}
-libc_hidden_proto(__XL_NPP(strtol))
libc_hidden_def(__XL_NPP(strtol))
#if (ULONG_MAX == UINTMAX_MAX) && !defined(L_strtol_l)
#if defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX)
+libc_hidden_proto(__XL_NPP(strtoll))
long long __XL_NPP(strtoll)(const char * __restrict str,
char ** __restrict endptr, int base
__LOCALE_PARAM )
return (long long) __XL_NPP(_stdlib_strto_ll)(str, endptr, base, 1
__LOCALE_ARG );
}
-libc_hidden_proto(__XL_NPP(strtoll))
libc_hidden_def(__XL_NPP(strtoll))
#if !defined(L_strtoll_l)
/**********************************************************************/
#if defined(L_strtoul) || defined(L_strtoul_l)
+libc_hidden_proto(__XL_NPP(strtoul))
unsigned long __XL_NPP(strtoul)(const char * __restrict str,
char ** __restrict endptr, int base
__LOCALE_PARAM )
{
return __XL_NPP(_stdlib_strto_l)(str, endptr, base, 0 __LOCALE_ARG );
}
-libc_hidden_proto(__XL_NPP(strtoul))
libc_hidden_def(__XL_NPP(strtoul))
#if (ULONG_MAX == UINTMAX_MAX) && !defined(L_strtoul_l)
#if defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX)
+libc_hidden_proto(__XL_NPP(strtoull))
unsigned long long __XL_NPP(strtoull)(const char * __restrict str,
char ** __restrict endptr, int base
__LOCALE_PARAM )
{
return __XL_NPP(_stdlib_strto_ll)(str, endptr, base, 0 __LOCALE_ARG );
}
-libc_hidden_proto(__XL_NPP(strtoull))
libc_hidden_def(__XL_NPP(strtoull))
#if !defined(L_strtoull_l)
* calculation, as well as to reduce the generated code size with
* bcc and gcc. */
+libc_hidden_proto(qsort)
void qsort (void *base,
size_t nel,
size_t width,
} while (wgap);
}
}
-libc_hidden_proto(qsort)
libc_hidden_def(qsort)
/* ---------- original snippets version below ---------- */
/**********************************************************************/
#ifdef L__stdlib_mb_cur_max
+libc_hidden_proto(_stdlib_mb_cur_max)
size_t _stdlib_mb_cur_max(void)
{
#ifdef __CTYPE_HAS_UTF_8_LOCALES
return 1;
#endif
}
-libc_hidden_proto(_stdlib_mb_cur_max)
libc_hidden_def(_stdlib_mb_cur_max)
#endif
/**********************************************************************/
#if defined(L_wcstol) || defined(L_wcstol_l)
+libc_hidden_proto(__XL_NPP(wcstol))
long __XL_NPP(wcstol)(const wchar_t * __restrict str,
wchar_t ** __restrict endptr, int base __LOCALE_PARAM )
{
return __XL_NPP(_stdlib_wcsto_l)(str, endptr, base, 1 __LOCALE_ARG );
}
-libc_hidden_proto(__XL_NPP(wcstol))
libc_hidden_def(__XL_NPP(wcstol))
#if (ULONG_MAX == UINTMAX_MAX) && !defined(L_wcstol_l)
#if defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX)
+libc_hidden_proto(__XL_NPP(wcstoll))
long long __XL_NPP(wcstoll)(const wchar_t * __restrict str,
wchar_t ** __restrict endptr, int base
__LOCALE_PARAM )
return (long long) __XL_NPP(_stdlib_wcsto_ll)(str, endptr, base, 1
__LOCALE_ARG );
}
-libc_hidden_proto(__XL_NPP(wcstoll))
libc_hidden_def(__XL_NPP(wcstoll))
#if !defined(L_wcstoll_l)
/**********************************************************************/
#if defined(L_wcstoul) || defined(L_wcstoul_l)
+libc_hidden_proto(__XL_NPP(wcstoul))
unsigned long __XL_NPP(wcstoul)(const wchar_t * __restrict str,
wchar_t ** __restrict endptr, int base
__LOCALE_PARAM )
{
return __XL_NPP(_stdlib_wcsto_l)(str, endptr, base, 0 __LOCALE_ARG );
}
-libc_hidden_proto(__XL_NPP(wcstoul))
libc_hidden_def(__XL_NPP(wcstoul))
#if (ULONG_MAX == UINTMAX_MAX) && !defined(L_wcstoul_l)
#if defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX)
+libc_hidden_proto(__XL_NPP(wcstoull))
unsigned long long __XL_NPP(wcstoull)(const wchar_t * __restrict str,
wchar_t ** __restrict endptr, int base
__LOCALE_PARAM )
{
return __XL_NPP(_stdlib_wcsto_ll)(str, endptr, base, 0 __LOCALE_ARG );
}
-libc_hidden_proto(__XL_NPP(wcstoull))
libc_hidden_def(__XL_NPP(wcstoull))
#if !defined(L_wcstoull_l)
#endif
+libc_hidden_proto(__XL_NPP(strtof))
float __XL_NPP(strtof)(const Wchar *str, Wchar **endptr __LOCALE_PARAM )
{
#if FPMAX_TYPE == 1
return y;
#endif
}
-libc_hidden_proto(__XL_NPP(strtof))
libc_hidden_def(__XL_NPP(strtof))
#endif
#define Wchar char
#endif
+libc_hidden_proto(__XL_NPP(strtod))
double __XL_NPP(strtod)(const Wchar *__restrict str,
Wchar **__restrict endptr __LOCALE_PARAM )
{
return y;
#endif
}
-libc_hidden_proto(__XL_NPP(strtod))
libc_hidden_def(__XL_NPP(strtod))
#endif
#define Wchar char
#endif
+libc_hidden_proto(__XL_NPP(strtold))
long double __XL_NPP(strtold) (const Wchar *str, Wchar **endptr __LOCALE_PARAM )
{
#if FPMAX_TYPE == 3
return y;
#endif
}
-libc_hidden_proto(__XL_NPP(strtold))
libc_hidden_def(__XL_NPP(strtold))
#endif
} while (1);
}
+libc_hidden_proto(__XL_NPP(wcscoll))
int __XL_NPP(wcscoll) (const Wchar *s0, const Wchar *s1 __LOCALE_PARAM )
{
col_state_t ws[2];
return 0;
}
-libc_hidden_proto(__XL_NPP(wcscoll))
libc_hidden_def(__XL_NPP(wcscoll))
#ifdef WANT_WIDE
extern size_t __wcslcpy(wchar_t *__restrict dst,
const wchar_t *__restrict src, size_t n);
+libc_hidden_proto(__XL_NPP(wcsxfrm))
size_t __XL_NPP(wcsxfrm)(wchar_t *__restrict ws1, const wchar_t *__restrict ws2,
size_t n __LOCALE_PARAM )
{
}
return count-1;
}
-libc_hidden_proto(__XL_NPP(wcsxfrm))
libc_hidden_def(__XL_NPP(wcsxfrm))
#else /* WANT_WIDE */
return r;
}
+libc_hidden_proto(__XL_NPP(strxfrm))
size_t __XL_NPP(strxfrm)(char *__restrict ws1, const char *__restrict ws2, size_t n
__LOCALE_PARAM )
{
}
return count-1;
}
-libc_hidden_proto(__XL_NPP(strxfrm))
libc_hidden_def(__XL_NPP(strxfrm))
#endif /* WANT_WIDE */
#include <stdlib.h>
#include <limits.h>
+libc_hidden_proto(memchr)
libc_hidden_proto(abort)
#include "memcopy.h"
return 0;
}
-libc_hidden_proto(memchr)
libc_hidden_def(memchr)
02111-1307 USA. */
#include <string.h>
-
#include "memcopy.h"
+libc_hidden_proto(memcmp)
+
#include <endian.h>
#if __BYTE_ORDER == __BIG_ENDIAN
return 0;
}
-libc_hidden_proto(memcmp)
libc_hidden_def(memcmp)
strong_alias(memcmp,bcmp)
#include "memcopy.h"
#include "pagecopy.h"
+libc_hidden_proto(memcpy)
+
/* _wordcopy_fwd_aligned -- Copy block beginning at SRCP to
block beginning at DSTP with LEN `op_t' words (not LEN bytes!).
Both SRCP and DSTP should be aligned for memory operations on `op_t's. */
return dstpp;
}
-libc_hidden_proto(memcpy)
libc_hidden_def(memcpy)
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#define _GNU_SOURCE
#include <string.h>
#include <stddef.h>
+libc_hidden_proto(memmem)
libc_hidden_proto(memcmp)
/* Return the first occurrence of NEEDLE in HAYSTACK. */
return NULL;
}
-libc_hidden_proto(memmem)
libc_hidden_def(memmem)
#include "memcopy.h"
#include "pagecopy.h"
+libc_hidden_proto(memmove)
libc_hidden_proto(memcpy)
static void _wordcopy_bwd_aligned (long int dstp, long int srcp, size_t len)
return (dest);
}
-libc_hidden_proto(memmove)
libc_hidden_def(memmove)
/* Ditch the glibc version and just wrap memcpy. */
+#define _GNU_SOURCE
#include <string.h>
+libc_hidden_proto(mempcpy)
libc_hidden_proto(memcpy)
void *mempcpy (void *dstpp, const void *srcpp, size_t len)
memcpy(dstpp, srcpp, len);
return (void *)(((char *)dstpp) + len);
}
-libc_hidden_proto(mempcpy)
libc_hidden_def(mempcpy)
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <limits.h>
+libc_hidden_proto(memrchr)
libc_hidden_proto(abort)
#include "memcopy.h"
return 0;
}
-libc_hidden_proto(memrchr)
libc_hidden_def(memrchr)
#include <string.h>
#include "memcopy.h"
+libc_hidden_proto(memset)
void *memset (void *dstpp, int c, size_t len)
{
long int dstp = (long int) dstpp;
return dstpp;
}
-libc_hidden_proto(memset)
libc_hidden_def(memset)
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <limits.h>
+libc_hidden_proto(rawmemchr)
libc_hidden_proto(abort)
#include "memcopy.h"
}
}
}
-libc_hidden_proto(rawmemchr)
libc_hidden_def(rawmemchr)
#include <string.h>
#include "memcopy.h"
+libc_hidden_proto(strcat)
/* Append SRC on the end of DEST. */
char *strcat (char *dest, const char *src)
{
return dest;
}
-libc_hidden_proto(strcat)
libc_hidden_def(strcat)
#include <string.h>
#include <stdlib.h>
+libc_hidden_proto(strchr)
libc_hidden_proto(abort)
#include "memcopy.h"
return NULL;
}
-libc_hidden_proto(strchr)
libc_hidden_def(strchr)
strong_alias(strchr,index)
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
+libc_hidden_proto(strchrnul)
libc_hidden_proto(abort)
#include "memcopy.h"
/* This should never happen. */
return NULL;
}
-libc_hidden_proto(strchrnul)
libc_hidden_def(strchrnul)
#include "memcopy.h"
+libc_hidden_proto(strcmp)
/* Compare S1 and S2, returning less than, equal to or
greater than zero if S1 is lexicographically less than,
equal to or greater than S2. */
return c1 - c2;
}
-libc_hidden_proto(strcmp)
libc_hidden_def(strcmp)
#ifndef __UCLIBC_HAS_LOCALE__
#include "memcopy.h"
#include "bp-checks.h"
+libc_hidden_proto(strcpy)
/* Copy SRC to DEST. */
char *strcpy (char *dest, const char *src)
{
return dest;
}
-libc_hidden_proto(strcpy)
libc_hidden_def(strcpy)
#include <string.h>
+libc_hidden_proto(strcspn)
libc_hidden_proto(strchr)
/* Return the length of the maximum initial segment of S
return count;
}
-libc_hidden_proto(strcspn)
libc_hidden_def(strcspn)
#include <string.h>
#include <stdlib.h>
+libc_hidden_proto(strlen)
libc_hidden_proto(abort)
/* Return the length of the null-terminated string STR. Scan for
}
}
}
-libc_hidden_proto(strlen)
libc_hidden_def(strlen)
#include "memcopy.h"
+libc_hidden_proto(strncat)
char *strncat (char *s1, const char *s2, size_t n)
{
reg_char c;
return s;
}
-libc_hidden_proto(strncat)
libc_hidden_def(strncat)
#include <string.h>
#include "memcopy.h"
+libc_hidden_proto(strncmp)
/* Compare no more than N characters of S1 and S2,
returning less than, equal to or greater than zero
if S1 is lexicographically less than, equal to or
return c1 - c2;
}
-libc_hidden_proto(strncmp)
libc_hidden_def(strncmp)
#include <string.h>
#include "memcopy.h"
+libc_hidden_proto(strncpy)
char *strncpy (char *s1, const char *s2, size_t n)
{
reg_char c;
return s;
}
-libc_hidden_proto(strncpy)
libc_hidden_def(strncpy)
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
+libc_hidden_proto(strnlen)
libc_hidden_proto(abort)
/* Find the length of S, but scan at most MAXLEN characters. If no
char_ptr = end_ptr;
return char_ptr - str;
}
-libc_hidden_proto(strnlen)
libc_hidden_def(strnlen)
#include <string.h>
+libc_hidden_proto(strrchr)
libc_hidden_proto(strchr)
/* Find the last occurrence of C in S. */
return (char *) found;
}
-libc_hidden_proto(strrchr)
libc_hidden_def(strrchr)
strong_alias(strrchr,rindex)
#include <string.h>
+libc_hidden_proto(strsep)
libc_hidden_proto(strchr)
libc_hidden_proto(strpbrk)
return begin;
}
-libc_hidden_proto(strsep)
libc_hidden_def(strsep)
#include <string.h>
+libc_hidden_proto(strspn)
/* Return the length of the maximum initial segment
of S which contains only characters in ACCEPT. */
size_t strspn (const char *s, const char *accept)
return count;
}
-libc_hidden_proto(strspn)
libc_hidden_def(strspn)
#include <string.h>
+libc_hidden_proto(strstr)
+
typedef unsigned chartype;
char *strstr (const char *phaystack, const char *pneedle)
ret0:
return 0;
}
-libc_hidden_proto(strstr)
libc_hidden_def(strstr)
#define _GNU_SOURCE
#include <string.h>
+libc_hidden_proto(strtok_r)
libc_hidden_proto(strspn)
libc_hidden_proto(strpbrk)
libc_hidden_proto(rawmemchr)
}
return token;
}
-libc_hidden_proto(strtok_r)
libc_hidden_def(strtok_r)
#include <string.h>
+libc_hidden_proto(memchr)
void *memchr(const void *cs, int c, size_t count)
{
int d0;
:"=D" (__res), "=&c" (d0) : "a" (c),"0" (cs),"1" (count));
return __res;
}
-libc_hidden_proto(memchr)
libc_hidden_def(memchr)
#include <string.h>
+libc_hidden_proto(memcpy)
void *memcpy(void * to, const void * from, size_t n)
{
int d0, d1, d2;
: "memory");
return (to);
}
-libc_hidden_proto(memcpy)
libc_hidden_def(memcpy)
#include <string.h>
+libc_hidden_proto(memmove)
void *memmove(void *dest, const void *src, size_t n)
{
int d0, d1, d2;
:"memory");
return dest;
}
-libc_hidden_proto(memmove)
libc_hidden_def(memmove)
#include <string.h>
+libc_hidden_proto(memset)
void *memset(void *s, int c, size_t count)
{
int d0, d1;
:"memory");
return s;
}
-libc_hidden_proto(memset)
libc_hidden_def(memset)
#include <string.h>
+libc_hidden_proto(strcat)
char *strcat(char * dest, const char * src)
{
int d0, d1, d2, d3;
: "0" (src), "1" (dest), "2" (0), "3" (0xffffffff):"memory");
return dest;
}
-libc_hidden_proto(strcat)
libc_hidden_def(strcat)
#include <string.h>
+libc_hidden_proto(strchr)
char *strchr(const char *s, int c)
{
int d0;
:"=a" (__res), "=&S" (d0) : "1" (s),"0" (c));
return __res;
}
-libc_hidden_proto(strchr)
libc_hidden_def(strchr)
strong_alias(strchr,index)
#include <string.h>
+libc_hidden_proto(strcmp)
int strcmp(const char *cs, const char *ct)
{
int d0, d1;
:"1" (cs),"2" (ct));
return __res;
}
-libc_hidden_proto(strcmp)
libc_hidden_def(strcmp)
#ifndef __UCLIBC_HAS_LOCALE__
#include <string.h>
+libc_hidden_proto(strcpy)
char *strcpy(char * dest, const char * src)
{
int d0, d1, d2;
:"0" (src),"1" (dest) : "memory");
return dest;
}
-libc_hidden_proto(strcpy)
libc_hidden_def(strcpy)
#include <string.h>
+libc_hidden_proto(strlen)
size_t strlen(const char *s)
{
int d0;
:"=c" (__res), "=&D" (d0) :"1" (s),"a" (0), "0" (0xffffffff));
return __res;
}
-libc_hidden_proto(strlen)
libc_hidden_def(strlen)
#include <string.h>
+libc_hidden_proto(strncat)
char *strncat(char * dest,
const char * src, size_t count)
{
: "memory");
return dest;
}
-libc_hidden_proto(strncat)
libc_hidden_def(strncat)
#include <string.h>
+libc_hidden_proto(strncmp)
int strncmp(const char *cs, const char *ct, size_t count)
{
register int __res;
:"1" (cs),"2" (ct),"3" (count));
return __res;
}
-libc_hidden_proto(strncmp)
libc_hidden_def(strncmp)
#include <string.h>
+libc_hidden_proto(strncpy)
char *strncpy(char * dest, const char * src, size_t count)
{
int d0, d1, d2, d3;
:"0" (src),"1" (dest),"2" (count) : "memory");
return dest;
}
-libc_hidden_proto(strncpy)
libc_hidden_def(strncpy)
#define _GNU_SOURCE
#include <string.h>
+libc_hidden_proto(strnlen)
size_t strnlen(const char *s, size_t count)
{
int d0;
:"c" (s),"1" (count));
return __res;
}
-libc_hidden_proto(strnlen)
libc_hidden_def(strnlen)
#include <string.h>
+libc_hidden_proto(strrchr)
char *strrchr(const char *s, int c)
{
int d0, d1;
:"=g" (__res), "=&S" (d0), "=&a" (d1) :"0" (0),"1" (s),"2" (c));
return __res;
}
-libc_hidden_proto(strrchr)
libc_hidden_def(strrchr)
strong_alias(strrchr,rindex)
#include <string.h>
+libc_hidden_proto(memcpy)
void *memcpy(void *to, const void *from, size_t n)
/* PPC can do pre increment and load/store, but not post increment and load/store.
Therefore use *++ptr instead of *ptr++. */
goto copy_chunks;
goto lessthan8;
}
-libc_hidden_proto(memcpy)
libc_hidden_def(memcpy)
#include <string.h>
+libc_hidden_proto(memmove)
void *memmove(void *to, const void *from, size_t n)
{
unsigned long rem, chunks, tmp1, tmp2;
goto copy_chunks;
goto lessthan8;
}
-libc_hidden_proto(memmove)
libc_hidden_def(memmove)
#include <string.h>
+libc_hidden_proto(memset)
+
static inline int expand_byte_word(int c){
/* this does:
c = c << 8 | c;
goto copy_chunks;
goto lessthan8;
}
-libc_hidden_proto(memset)
libc_hidden_def(memset)
libc_hidden_proto(strcasecmp_l)
+libc_hidden_proto(strcasecmp)
int strcasecmp(register const Wchar *s1, register const Wchar *s2)
{
return strcasecmp_l(s1, s2, __UCLIBC_CURLOCALE);
}
-libc_hidden_proto(strcasecmp)
libc_hidden_def(strcasecmp)
#else /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
+libc_hidden_proto(__XL_NPP(strcasecmp))
int __XL_NPP(strcasecmp)(register const Wchar *s1, register const Wchar *s2
__LOCALE_PARAM )
{
return r;
#endif
}
-libc_hidden_proto(__XL_NPP(strcasecmp))
libc_hidden_def(__XL_NPP(strcasecmp))
#endif /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
# define Wstrlcpy __wcslcpy
# define Wstrxfrm wcsxfrm
#else
+libc_hidden_proto(strlcpy)
# define Wstrlcpy strlcpy
# define Wstrxfrm strxfrm
#endif
return src - src0;
}
#ifndef WANT_WIDE
-libc_hidden_proto(strlcpy)
libc_hidden_def(strlcpy)
#ifndef __UCLIBC_HAS_LOCALE__
strong_alias(strlcpy,strxfrm)
libc_hidden_proto(strncasecmp_l)
+libc_hidden_proto(strncasecmp)
int strncasecmp(register const Wchar *s1, register const Wchar *s2, size_t n)
{
return strncasecmp_l(s1, s2, n, __UCLIBC_CURLOCALE);
}
-libc_hidden_proto(strncasecmp)
libc_hidden_def(strncasecmp)
#else /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
+libc_hidden_proto(__XL_NPP(strncasecmp))
int __XL_NPP(strncasecmp)(register const Wchar *s1, register const Wchar *s2,
size_t n __LOCALE_PARAM )
{
return r;
#endif
}
-libc_hidden_proto(__XL_NPP(strncasecmp))
libc_hidden_def(__XL_NPP(strncasecmp))
#endif /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <errno.h>
/* This routine is jumped to by all the syscall handlers, to stash
an error number into errno. */
-int __syscall_error (int err_no)
+int attribute_hidden __syscall_error (int err_no)
{
__set_errno (err_no);
return -1;
/* Wrapper for setting errno.
- Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <errno.h>
#include <features.h>
+#include <errno.h>
/* This routine is jumped to by all the syscall handlers, to stash
* an error number into errno. */
#include <unistd.h>
#include <sys/syscall.h>
+libc_hidden_proto(brk)
+
/* This must be initialized data because commons can't have aliases. */
void *__curbrk = 0;
#include <asm/page.h>
#include <sys/sysctl.h>
+libc_hidden_proto(ioperm)
+
libc_hidden_proto(readlink)
libc_hidden_proto(mmap)
libc_hidden_proto(sscanf)
return 0;
}
-libc_hidden_proto(ioperm)
libc_hidden_def(ioperm)
#include <sys/syscall.h>
#include <errno.h>
+libc_hidden_proto(brk)
+
/* This must be initialized data because commons can't have aliases. */
void * __curbrk = 0;
return 0;
}
-libc_hidden_proto(brk)
libc_hidden_def(brk)
/*
* libc/sysdeps/linux/bfin/clone.c -- `clone' syscall for linux/blackfin
*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * This file is subject to the terms and conditions of the GNU Lesser
- * General Public License. See the file COPYING.LIB in the main
- * directory of this archive for more details.
- *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <asm/unistd.h>
/* syscall for blackfin/uClibc
*
* Copyright (C) 2004 by Analog Devices Inc.
- * Copyright (C) 2002 by Erik Andersen <andersen@uclibc.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <features.h>
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
#include <features.h>
#include <asm/unistd.h>
.text
.globl _vfork
- .globl __libc_vfork
.type _vfork,STT_FUNC;
.align 4
-__libc_vfork:
_vfork:
p0 = __NR_vfork;
excpt 0;
rts;
-libc_hidden_def(_vfork)
/*
* __rt_sigtimedwait() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <signal.h>
#define __need_NULL
#include <stddef.h>
+
+libc_hidden_proto(sigwaitinfo)
+libc_hidden_proto(sigtimedwait)
+
#ifdef __NR_rt_sigtimedwait
#define __NR___rt_sigtimedwait __NR_rt_sigtimedwait
static _syscall4(int, __rt_sigtimedwait, const sigset_t *, set, siginfo_t *, info,
return -1;
}
#endif
-libc_hidden_proto(sigwaitinfo)
libc_hidden_def(sigwaitinfo)
-libc_hidden_proto(sigtimedwait)
libc_hidden_def(sigtimedwait)
/*
* __socketcall() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* __syscall_fcntl() for uClibc
*
- * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <fcntl.h>
#include <bits/wordsize.h>
+extern int __libc_fcntl(int fd, int cmd, ...);
+libc_hidden_proto(__libc_fcntl)
+
#if defined __UCLIBC_HAS_LFS__ && defined __NR_fcntl64
extern int __libc_fcntl64(int fd, int cmd, ...);
libc_hidden_proto(__libc_fcntl64)
return (__syscall_fcntl(fd, cmd, arg));
}
-libc_hidden_proto(__libc_fcntl)
libc_hidden_def(__libc_fcntl)
strong_alias(__libc_fcntl,fcntl)
/*
* __syscall_fcntl64() for uClibc
*
- * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <fcntl.h>
#if defined __UCLIBC_HAS_LFS__ && defined __NR_fcntl64
+extern int __libc_fcntl64(int fd, int cmd, ...);
+libc_hidden_proto(__libc_fcntl64)
+
#define __NR___syscall_fcntl64 __NR_fcntl64
static inline _syscall3(int, __syscall_fcntl64, int, fd, int, cmd, long, arg);
int __libc_fcntl64(int fd, int cmd, ...)
va_end(list);
return (__syscall_fcntl64(fd, cmd, arg));
}
-libc_hidden_proto(__libc_fcntl64)
libc_hidden_def(__libc_fcntl64)
strong_alias(__libc_fcntl64,fcntl64)
/*
* __syscall_ipc() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* __syscall_rt_sigaction() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
attribute_hidden _syscall4(int, __syscall_rt_sigaction, int, signum,
const struct sigaction *, act, struct sigaction *, oldact,
size_t, size);
-
#endif
/*
* __syscall_sigaction() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* exit syscall for uClibc
*
- * Copyright (C) 2002 by Erik Andersen <andersen@codepoet.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#define _GNU_SOURCE
#include <features.h>
#include <errno.h>
+#include <unistd.h>
#include <sys/types.h>
#include <sys/syscall.h>
+libc_hidden_proto(_exit)
+
#ifndef INLINE_SYSCALL
#define INLINE_SYSCALL(name, nr, args...) __syscall_exit (args)
#define __NR___syscall_exit __NR_exit
while(1)
INLINE_SYSCALL(exit, 1, status);
}
-libc_hidden_proto(_exit)
libc_hidden_def(_exit)
/*
* access() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* acct() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* adjtimex() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <sys/timex.h>
-_syscall1(int, adjtimex, struct timex *, buf);
libc_hidden_proto(adjtimex)
+
+_syscall1(int, adjtimex, struct timex *, buf);
libc_hidden_def(adjtimex)
strong_alias(adjtimex,ntp_adjtime)
/*
* alarm() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
+
+libc_hidden_proto(alarm)
+
#ifdef __NR_alarm
#define __NR___alarm __NR_alarm
_syscall1(unsigned int, alarm, unsigned int, seconds);
return retval;
}
#endif
-libc_hidden_proto(alarm)
libc_hidden_def(alarm)
/*
* bdflush() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* capget() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
-# ifdef __NR_capget
+#ifdef __NR_capget
_syscall2(int, capget, void *, header, void *, data);
-# else
+#else
int capget(void *header, void *data)
{
__set_errno(ENOSYS);
return -1;
}
-# endif
+#endif
/*
* capset() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
-# ifdef __NR_capset
+#ifdef __NR_capset
_syscall2(int, capset, void *, header, const void *, data);
-# else
+#else
int capset(void *header, const void *data)
{
__set_errno(ENOSYS);
return -1;
}
-# endif
+#endif
/*
* chdir() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <string.h>
+#include <unistd.h>
#include <sys/param.h>
+libc_hidden_proto(chdir)
+
#define __NR___syscall_chdir __NR_chdir
static inline _syscall1(int, __syscall_chdir, const char *, path);
int chdir(const char *path)
{
return __syscall_chdir(path);
}
-libc_hidden_proto(chdir)
libc_hidden_def(chdir)
/*
* chmod() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <sys/stat.h>
+libc_hidden_proto(chmod)
+
#define __NR___syscall_chmod __NR_chmod
static inline _syscall2(int, __syscall_chmod, const char *, path, __kernel_mode_t, mode);
{
return __syscall_chmod(path, mode);
}
-libc_hidden_proto(chmod)
libc_hidden_def(chmod)
/*
* chown() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* chroot() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
* clock_getres() for uClibc
*
* Copyright (C) 2005 by Peter Kjellerstedt <pkj@axis.com>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#define _GNU_SOURCE
*
* Copyright (C) 2003 by Justus Pendleton <uc@ryoohki.net>
* Copyright (C) 2005 by Peter Kjellerstedt <pkj@axis.com>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#define _GNU_SOURCE
* clock_settime() for uClibc
*
* Copyright (C) 2005 by Peter Kjellerstedt <pkj@axis.com>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#define _GNU_SOURCE
/*
* close() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <features.h>
#include <sys/socket.h>
+libc_hidden_proto(__cmsg_nxthdr)
+
struct cmsghdr *
__cmsg_nxthdr (struct msghdr *mhdr, struct cmsghdr *cmsg)
{
return NULL;
return cmsg;
}
-libc_hidden_proto(__cmsg_nxthdr)
libc_hidden_def(__cmsg_nxthdr)
/* Syscalls for uClibc
*
* Copyright (C) 2000 by Lineo, inc. and Erik Andersen
- * Copyright (C) 2000,2001 by Erik Andersen <andersen@uclibc.org>
- * Written by Erik Andersen <andersen@uclibc.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*/
#include <errno.h>
#include <sys/types.h>
#include <sys/syscall.h>
-
#ifdef __NR_create_module
#if defined(__i386__) || defined(__m68k__) || defined(__arm__) || defined(__thumb__) || defined(__cris__) || defined(__i960__)
/* vi: set sw=4 ts=4: */
/*
* delete_module() for uClibc
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
- *
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/* vi: set sw=4 ts=4: */
/*
* dup() for uClibc
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
- *
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* dup2() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
-_syscall2(int, dup2, int, oldfd, int, newfd);
+
libc_hidden_proto(dup2)
+
+_syscall2(int, dup2, int, oldfd, int, newfd);
libc_hidden_def(dup2)
/*
* epoll_create() / epoll_ctl() / epoll_wait() for uClibc
*
- * Copyright (C) 2005 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* execve() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <string.h>
#include <sys/param.h>
+libc_hidden_proto(execve)
+
#define __NR___syscall_execve __NR_execve
static inline _syscall3(int, __syscall_execve, const char *, filename,
char *const *, argv, char *const *, envp);
{
return __syscall_execve(filename, argv, envp);
}
-libc_hidden_proto(execve)
libc_hidden_def(execve)
/*
* fchdir() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
-_syscall1(int, fchdir, int, fd);
+
libc_hidden_proto(fchdir)
+
+_syscall1(int, fchdir, int, fd);
libc_hidden_def(fchdir)
/*
* fchmod() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* fdatasync() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* flock() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* fork() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* fstat() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
-/* need to hide the 64bit prototype or the weak_alias()
+/* need to hide the 64bit prototype or the strong_alias()
* will fail when __NR_fstat64 doesnt exist */
#define fstat64 __hidefstat64
#undef fstat64
+libc_hidden_proto(fstat)
+
#define __NR___syscall_fstat __NR_fstat
-#undef fstat
static inline _syscall2(int, __syscall_fstat, int, fd, struct kernel_stat *, buf);
int fstat(int fd, struct stat *buf)
}
return result;
}
-libc_hidden_proto(fstat)
libc_hidden_def(fstat)
#if ! defined __NR_fstat64 && defined __UCLIBC_HAS_LFS__
/*
* fstat64() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#if defined __UCLIBC_HAS_LFS__ && defined __NR_fstat64
-#define __NR___syscall_fstat64 __NR_fstat64
#include <unistd.h>
#include <sys/stat.h>
#include "xstatconv.h"
+libc_hidden_proto(fstat64)
+
+#define __NR___syscall_fstat64 __NR_fstat64
static inline _syscall2(int, __syscall_fstat64,
int, filedes, struct kernel_stat64 *, buf);
}
return result;
}
-libc_hidden_proto(fstat64)
libc_hidden_def(fstat64)
-
-#endif /* __UCLIBC_HAS_LFS__ */
+#endif
/*
* fstatfs() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <sys/vfs.h>
-_syscall2(int, fstatfs, int, fd, struct statfs *, buf);
+
libc_hidden_proto(fstatfs)
+
+_syscall2(int, fstatfs, int, fd, struct statfs *, buf);
libc_hidden_def(fstatfs)
/*
* fsync() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* ftruncate() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
-_syscall2(int, ftruncate, int, fd, __off_t, length);
+
libc_hidden_proto(ftruncate)
+
+_syscall2(int, ftruncate, int, fd, __off_t, length);
libc_hidden_def(ftruncate)
/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ *
* ftruncate64 syscall. Copes with 64 bit and 32 bit machines
* and on 32 bit machines this sends things into the kernel as
* two 32-bit arguments (high and low 32 bits of length) that
* are ordered based on endianess. It turns out endian.h has
* just the macro we need to order things, __LONG_LONG_PAIR.
- *
- * Copyright (C) 2002 Erik Andersen <andersen@codepoet.org>
- *
- * This file is subject to the terms and conditions of the GNU
- * Lesser General Public License. See the file COPYING.LIB in
- * the main directory of this archive for more details.
*/
#include <features.h>
-#include <unistd.h>
-#include <errno.h>
-#include <endian.h>
-#include <stdint.h>
-#include <sys/types.h>
-#include <sys/syscall.h>
-#if defined __UCLIBC_HAS_LFS__
+#ifdef __UCLIBC_HAS_LFS__
+
+# include <unistd.h>
+# include <errno.h>
+# include <endian.h>
+# include <stdint.h>
+# include <sys/types.h>
+# include <sys/syscall.h>
+
+libc_hidden_proto(ftruncate64)
-#if defined __NR_ftruncate64
+# ifdef __NR_ftruncate64
-#if __WORDSIZE == 64
+# if __WORDSIZE == 64
/* For a 64 bit machine, life is simple... */
_syscall2(int, ftruncate64, int, fd, __off64_t, length);
-#elif __WORDSIZE == 32
+# elif __WORDSIZE == 32
-#ifndef INLINE_SYSCALL
-#define INLINE_SYSCALL(name, nr, args...) __syscall_ftruncate64 (args)
-#define __NR___syscall_ftruncate64 __NR_ftruncate64
-#if defined(__powerpc__) || defined(__mips__)
+# ifndef INLINE_SYSCALL
+# define INLINE_SYSCALL(name, nr, args...) __syscall_ftruncate64 (args)
+# define __NR___syscall_ftruncate64 __NR_ftruncate64
+# if defined(__powerpc__) || defined(__mips__)
static inline _syscall4(int, __syscall_ftruncate64, int, fd, uint32_t, pad,
unsigned long, high_length, unsigned long, low_length);
-#else
+# else
static inline _syscall3(int, __syscall_ftruncate64, int, fd,
unsigned long, high_length, unsigned long, low_length);
-#endif
-#endif
+# endif
+# endif
/* The exported ftruncate64 function. */
int ftruncate64 (int fd, __off64_t length)
{
uint32_t low = length & 0xffffffff;
uint32_t high = length >> 32;
-#if defined(__powerpc__) || defined(__mips__)
+# if defined(__powerpc__) || defined(__mips__)
return INLINE_SYSCALL(ftruncate64,
4, fd, 0, __LONG_LONG_PAIR (high, low));
-#else
+# else
return INLINE_SYSCALL(ftruncate64, 3, fd,
__LONG_LONG_PAIR (high, low));
-#endif
+# endif
}
-#else /* __WORDSIZE */
-#error Your machine is not 64 bit or 32 bit, I am dazed and confused.
-#endif /* __WORDSIZE */
+# else /* __WORDSIZE */
+# error Your machine is not 64 bit or 32 bit, I am dazed and confused.
+# endif /* __WORDSIZE */
-#else /* __NR_ftruncate64 */
+# else /* __NR_ftruncate64 */
libc_hidden_proto(ftruncate)
return -1;
}
-#endif /* __NR_ftruncate64 */
+# endif /* __NR_ftruncate64 */
+libc_hidden_def(ftruncate64)
#endif /* __UCLIBC_HAS_LFS__ */
/*
* get_kernel_syms() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <sys/stat.h>
#include <dirent.h>
#include <string.h>
+#include <unistd.h>
#include <sys/syscall.h>
+libc_hidden_proto(getcwd)
+
libc_hidden_proto(strcat)
libc_hidden_proto(strcpy)
libc_hidden_proto(strncpy)
#ifdef __NR_getcwd
-#define __NR___syscall_getcwd __NR_getcwd
+# define __NR___syscall_getcwd __NR_getcwd
static inline
_syscall2(int, __syscall_getcwd, char *, buf, unsigned long, size);
int slen;
struct stat st;
-#ifdef FAST_DIR_SEARCH_POSSIBLE
+# ifdef FAST_DIR_SEARCH_POSSIBLE
/* The test is for ELKS lib 0.0.9, this should be fixed in the real kernel */
int slow_search = (sizeof(ino_t) != sizeof(d->d_ino));
-#endif
+# endif
if (stat(path_buf, &st) < 0) {
goto oops;
}
-#ifdef FAST_DIR_SEARCH_POSSIBLE
+# ifdef FAST_DIR_SEARCH_POSSIBLE
if (this_dev != st.st_dev)
slow_search = 1;
-#endif
+# endif
slen = strlen(path_buf);
ptr = path_buf + slen - 1;
}
while ((d = readdir(dp)) != 0) {
-#ifdef FAST_DIR_SEARCH_POSSIBLE
+# ifdef FAST_DIR_SEARCH_POSSIBLE
if (slow_search || this_ino == d->d_ino) {
-#endif
+# endif
if (slen + strlen(d->d_name) > path_size) {
goto oops;
}
closedir(dp);
return path_buf;
}
-#ifdef FAST_DIR_SEARCH_POSSIBLE
+# ifdef FAST_DIR_SEARCH_POSSIBLE
}
-#endif
+# endif
}
closedir(dp);
return len;
}
-#endif
+#endif /* __NR_getcwd */
char *getcwd(char *buf, size_t size)
{
free (path);
return NULL;
}
-libc_hidden_proto(getcwd)
libc_hidden_def(getcwd)
-/* Copyright (C) 1993, 1995-2002 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <alloca.h>
#include <assert.h>
libc_hidden_proto(lseek)
#ifndef offsetof
-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+# define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif
struct kernel_dirent
#define __NR___syscall_getdents __NR_getdents
static inline _syscall3(int, __syscall_getdents, int, fd, unsigned char *, kdirp, size_t, count);
-
ssize_t attribute_hidden __getdents (int fd, char *buf, size_t nbytes)
{
struct dirent *dp;
-/* Copyright (C) 1993, 1995-2002 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <features.h>
#include <alloca.h>
#include <sys/types.h>
#include <sys/syscall.h>
+#if defined __UCLIBC_HAS_LFS__ && defined __NR_getdents64
+
libc_hidden_proto(memcpy)
libc_hidden_proto(lseek64)
-#if defined __UCLIBC_HAS_LFS__ && defined __NR_getdents64
-
-#ifndef offsetof
-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
-#endif
+# ifndef offsetof
+# define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+# endif
struct kernel_dirent64
{
};
-#define __NR___syscall_getdents64 __NR_getdents64
+# define __NR___syscall_getdents64 __NR_getdents64
static inline _syscall3(int, __syscall_getdents64, int, fd, unsigned char *, dirp, size_t, count);
-
ssize_t attribute_hidden __getdents64 (int fd, char *buf, size_t nbytes)
{
struct dirent64 *dp;
#define __USE_GNU
#include <sys/utsname.h>
+libc_hidden_proto(getdomainname)
+
libc_hidden_proto(strlen)
libc_hidden_proto(strcpy)
libc_hidden_proto(uname)
strcpy(name, uts.domainname);
return 0;
}
-libc_hidden_proto(getdomainname)
libc_hidden_def(getdomainname)
-/* Copyright (C) 1991, 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <stdlib.h>
#include <unistd.h>
#include <sys/resource.h>
#include <limits.h>
+libc_hidden_proto(getdtablesize)
+
libc_hidden_proto(getrlimit)
#define __LOCAL_OPEN_MAX 256
returns -1. */
return getrlimit (RLIMIT_NOFILE, &ru) < 0 ? __LOCAL_OPEN_MAX : ru.rlim_cur;
}
-libc_hidden_proto(getdtablesize)
libc_hidden_def(getdtablesize)
/*
* getegid() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
+libc_hidden_proto(getegid)
+
#ifdef __NR_getegid
#define __NR___syscall_getegid __NR_getegid
static inline _syscall0(int, __syscall_getegid);
return (getgid());
}
#endif
-libc_hidden_proto(getegid)
libc_hidden_def(getegid)
/*
* geteuid() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
+libc_hidden_proto(geteuid)
+
#ifdef __NR_geteuid
#define __NR___syscall_geteuid __NR_geteuid
static inline _syscall0(int, __syscall_geteuid);
return (getuid());
}
#endif
-libc_hidden_proto(geteuid)
libc_hidden_def(geteuid)
/*
* getgid() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
+libc_hidden_proto(getgid)
+
#define __NR___syscall_getgid __NR_getgid
#if defined (__alpha__)
#define __NR_getgid __NR_getxgid
{
return (__syscall_getgid());
}
-libc_hidden_proto(getgid)
libc_hidden_def(getgid)
/*
* getgroups() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
#include <grp.h>
+libc_hidden_proto(getgroups)
+
libc_hidden_proto(sysconf)
#define MIN(a,b) (((a)<(b))?(a):(b))
return ngids;
}
}
-libc_hidden_proto(getgroups)
libc_hidden_def(getgroups)
#include <sys/utsname.h>
#include <errno.h>
+libc_hidden_proto(gethostname)
+
libc_hidden_proto(strlen)
libc_hidden_proto(strcpy)
libc_hidden_proto(uname)
strcpy(name, uts.nodename);
return 0;
}
-libc_hidden_proto(gethostname)
libc_hidden_def(gethostname)
/*
* getitimer() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* getpgid() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* getpriority() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <sys/resource.h>
+libc_hidden_proto(getpriority)
+
#define __NR___syscall_getpriority __NR_getpriority
static inline _syscall2(int, __syscall_getpriority,
__priority_which_t, which, id_t, who);
res = PZERO - res;
return res;
}
-libc_hidden_proto(getpriority)
libc_hidden_def(getpriority)
/*
* getresgid() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#ifdef __NR_getresgid
-#define __NR___syscall_getresgid __NR_getresgid
+# define __NR___syscall_getresgid __NR_getresgid
static inline _syscall3(int, __syscall_getresgid, __kernel_gid_t *, egid,
__kernel_gid_t *, rgid, __kernel_gid_t *, sgid);
/*
* getresuid() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#ifdef __NR_getresuid
-#define __NR___syscall_getresuid __NR_getresuid
+# define __NR___syscall_getresuid __NR_getresuid
static inline _syscall3(int, __syscall_getresuid, __kernel_uid_t *, ruid,
__kernel_uid_t *, euid, __kernel_uid_t *, suid);
/*
* getrlimit() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
#include <sys/resource.h>
+libc_hidden_proto(getrlimit)
+
#ifdef __NR_ugetrlimit
-#define __NR___ugetrlimit __NR_ugetrlimit
+# define __NR___ugetrlimit __NR_ugetrlimit
static inline
_syscall2(int, __ugetrlimit, enum __rlimit_resource, resource,
struct rlimit *, rlim);
#else /* __NR_ugetrlimit */
/* Only include the old getrlimit if the new one (ugetrlimit) is not around */
-#define __NR___syscall_getrlimit __NR_getrlimit
+# define __NR___syscall_getrlimit __NR_getrlimit
static inline
_syscall2(int, __syscall_getrlimit, int, resource, struct rlimit *, rlim);
return result;
}
#endif
-
-libc_hidden_proto(getrlimit)
libc_hidden_def(getrlimit)
/*
* getrusage() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* getsid() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
+libc_hidden_proto(getsid)
+
#define __NR___syscall_getsid __NR_getsid
static inline _syscall1(__kernel_pid_t, __syscall_getsid, __kernel_pid_t, pid);
{
return (__syscall_getsid(pid));
}
-libc_hidden_proto(getsid)
libc_hidden_def(getsid)
/*
* gettimeofday() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <sys/time.h>
-_syscall2(int, gettimeofday, struct timeval *, tv, struct timezone *, tz);
+
libc_hidden_proto(gettimeofday)
+
+_syscall2(int, gettimeofday, struct timeval *, tv, struct timezone *, tz);
libc_hidden_def(gettimeofday)
/*
* getuid() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
+libc_hidden_proto(getuid)
+
#if defined (__alpha__)
#define __NR_getuid __NR_getxuid
#endif
{
return (__syscall_getuid());
}
-libc_hidden_proto(getuid)
libc_hidden_def(getuid)
/*
* init_module() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* ioctl() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* ioperm() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* iopl() for uClibc
*
- * Copyright (C) 2000-2005 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* kill() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <signal.h>
-#undef kill
+libc_hidden_proto(kill)
+
#define __NR___syscall_kill __NR_kill
static inline _syscall2(int, __syscall_kill, __kernel_pid_t, pid, int, sig);
{
return (__syscall_kill(pid, sig));
}
-libc_hidden_proto(kill)
libc_hidden_def(kill)
/*
* klogctl() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* lchown() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* link() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* llseek/lseek64 syscall for uClibc
*
- * Copyright (C) 2002 by Erik Andersen <andersen@codepoet.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#define _GNU_SOURCE
#if defined __NR__llseek && defined __UCLIBC_HAS_LFS__
-#ifndef INLINE_SYSCALL
-#define INLINE_SYSCALL(name, nr, args...) __syscall_llseek (args)
-#define __NR___syscall_llseek __NR__llseek
+# ifndef INLINE_SYSCALL
+# define INLINE_SYSCALL(name, nr, args...) __syscall_llseek (args)
+# define __NR___syscall_llseek __NR__llseek
static inline _syscall5(int, __syscall_llseek, int, fd, off_t, offset_hi,
off_t, offset_lo, loff_t *, result, int, whence);
-#endif
+# endif
loff_t __libc_lseek64(int fd, loff_t offset, int whence)
{
#else
extern __off_t __libc_lseek(int fildes, off_t offset, int whence);
libc_hidden_proto(__libc_lseek)
+
loff_t __libc_lseek64(int fd, loff_t offset, int whence)
{
return(loff_t)(__libc_lseek(fd, (off_t) (offset), whence));
/*
* lseek() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
+extern __off_t __libc_lseek (int __fd, __off_t __offset, int __whence) __THROW;
+libc_hidden_proto(__libc_lseek)
+
#define __NR___libc_lseek __NR_lseek
_syscall3(__off_t, __libc_lseek, int, fildes, __off_t, offset, int, whence);
-libc_hidden_proto(__libc_lseek)
libc_hidden_def(__libc_lseek)
strong_alias(__libc_lseek,lseek)
/*
* lstat() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
/* need to hide the 64bit prototype or the weak_alias()
#undef lstat64
+libc_hidden_proto(lstat)
+
#define __NR___syscall_lstat __NR_lstat
-#undef lstat
static inline _syscall2(int, __syscall_lstat,
const char *, file_name, struct kernel_stat *, buf);
}
return result;
}
-libc_hidden_proto(lstat)
libc_hidden_def(lstat)
#if ! defined __NR_lstat64 && defined __UCLIBC_HAS_LFS__
/*
* lstat64() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#if defined __UCLIBC_HAS_LFS__ && defined __NR_lstat64
-#include <unistd.h>
-#include <sys/stat.h>
-#include "xstatconv.h"
+# include <unistd.h>
+# include <sys/stat.h>
+# include "xstatconv.h"
-#define __NR___syscall_lstat64 __NR_lstat64
+libc_hidden_proto(lstat64)
+
+# define __NR___syscall_lstat64 __NR_lstat64
static inline _syscall2(int, __syscall_lstat64, const char *, file_name,
struct kernel_stat64 *, buf);
}
return result;
}
-libc_hidden_proto(lstat64)
libc_hidden_def(lstat64)
-#endif /* __UCLIBC_HAS_LFS__ */
+#endif
/*
* madvise() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
-/*
- * Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvs/uClibc/libc/sysdeps/linux/common/mincore.c,v 1.1 2004/12/20 00:10:51 solar Exp $
- *
+/*
* This file provides the mincore() system call to uClibc.
- * 20041215 - <solar@gentoo.org>
+ * Copyright (C) 20041215 - <solar@gentoo.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* mkdir() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <sys/stat.h>
+libc_hidden_proto(mkdir)
+
#define __NR___syscall_mkdir __NR_mkdir
static inline _syscall2(int, __syscall_mkdir, const char *, pathname,
__kernel_mode_t, mode);
{
return (__syscall_mkdir(pathname, mode));
}
-libc_hidden_proto(mkdir)
libc_hidden_def(mkdir)
/*
* mknod() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <sys/stat.h>
#include <sys/sysmacros.h>
+libc_hidden_proto(mknod)
+
#define __NR___syscall_mknod __NR_mknod
static inline _syscall3(int, __syscall_mknod, const char *, path,
__kernel_mode_t, mode, __kernel_dev_t, dev);
k_dev = ((major(dev) & 0xff) << 8) | (minor(dev) & 0xff);
return __syscall_mknod(path, mode, k_dev);
}
-libc_hidden_proto(mknod)
libc_hidden_def(mknod)
/*
* mlock() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* mlockall() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/* vi: set sw=4 ts=4: */
/*
- * _mmap() for uClibc
+ * mmap() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <sys/mman.h>
#ifdef __NR_mmap
+
+libc_hidden_proto(mmap)
+
#define __NR__mmap __NR_mmap
static inline _syscall1(__ptr_t, _mmap, unsigned long *, buffer);
__ptr_t mmap(__ptr_t addr, size_t len, int prot,
buffer[5] = (unsigned long) offset;
return (__ptr_t) _mmap(buffer);
}
-libc_hidden_proto(mmap)
libc_hidden_def(mmap)
#endif
-/* Copyright (C) 1997, 1998, 1999, 2002 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Daniel Jacobowitz <dan@debian.org>, 1999.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
/* Massivly hacked up for uClibc by Erik Andersen */
#include <features.h>
#include <unistd.h>
#include <sys/mman.h>
-#if defined __UCLIBC_HAS_LFS__
+#ifdef __UCLIBC_HAS_LFS__
+
+libc_hidden_proto(mmap)
#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64
-#undef _FILE_OFFSET_BITS
-#define _FILE_OFFSET_BITS 64
+# undef _FILE_OFFSET_BITS
+# define _FILE_OFFSET_BITS 64
#endif
#ifndef __USE_LARGEFILE64
# define __USE_LARGEFILE64 1
# undef __USE_FILE_OFFSET64
#endif
-
-#if ! defined __NR_mmap2 || ! defined _syscall6
-
-libc_hidden_proto(mmap)
+# if ! defined __NR_mmap2 || ! defined _syscall6
/*
* This version is a stub that just chops off everything at the mmap 32 bit
return mmap (addr, len, prot, flags, fd, (off_t) offset);
}
-#else
+# else
-#define __NR___syscall_mmap2 __NR_mmap2
+# define __NR___syscall_mmap2 __NR_mmap2
static inline _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr,
size_t, len, int, prot, int, flags, int, fd, off_t, offset);
/* This is always 12, even on architectures where PAGE_SHIFT != 12. */
-# ifndef MMAP2_PAGE_SHIFT
-# define MMAP2_PAGE_SHIFT 12
-# endif
+# ifndef MMAP2_PAGE_SHIFT
+# define MMAP2_PAGE_SHIFT 12
+# endif
__ptr_t mmap64(__ptr_t addr, size_t len, int prot, int flags, int fd, __off64_t offset)
{
return(__syscall_mmap2(addr, len, prot, flags, fd, (off_t) (offset >> MMAP2_PAGE_SHIFT)));
}
-#endif
+# endif
#endif /* __UCLIBC_HAS_LFS__ */
/*
* modify_ldt() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#ifdef __NR_modify_ldt
_syscall3(int, modify_ldt, int, func, void *, ptr, unsigned long, bytecount);
-/*weak_alias(modify_ldt, __modify_ldt)*/
#endif
/*
* mount() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* mprotect() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* mremap() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
#include <sys/mman.h>
+
+libc_hidden_proto(mremap)
+
_syscall4(__ptr_t, mremap, __ptr_t, old_address, size_t, old_size, size_t,
new_size, int, may_move);
-libc_hidden_proto(mremap)
libc_hidden_def(mremap)
/*
* msync() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* munlock() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* munlockall() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* munmap() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
#include <sys/mman.h>
-_syscall2(int, munmap, void *, start, size_t, length);
+
libc_hidden_proto(munmap)
+
+_syscall2(int, munmap, void *, start, size_t, length);
libc_hidden_def(munmap)
/*
* nanosleep() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <time.h>
+
#define __NR___libc_nanosleep __NR_nanosleep
_syscall2(int, __libc_nanosleep, const struct timespec *, req,
struct timespec *, rem);
/*
* nice() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
* Copyright (C) 2005 by Manuel Novoa III <mjn3@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#ifdef __NR_nice
-#define __NR___syscall_nice __NR_nice
+# define __NR___syscall_nice __NR_nice
static inline _syscall1(int, __syscall_nice, int, incr);
#else
-#include <limits.h>
+# include <limits.h>
libc_hidden_proto(setpriority)
static inline int __syscall_nice(int incr)
{
int old_priority;
-#if 1
+# if 1
/* This should never fail. */
old_priority = getpriority(PRIO_PROCESS, 0);
-#else
+# else
/* But if you want to be paranoid... */
int old_errno;
return -1;
}
__set_errno(old_errno);
-#endif
+# endif
if (setpriority(PRIO_PROCESS, 0, int_add_no_wrap(old_priority, incr))) {
__set_errno(EPERM); /* SUSv3 mandates EPERM for nice failure. */
/*
* open() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <string.h>
#include <sys/param.h>
+extern int __libc_open(const char *file, int flags, ...);
+libc_hidden_proto(__libc_open)
+
#define __NR___syscall_open __NR_open
static inline _syscall3(int, __syscall_open, const char *, file,
int, flags, __kernel_mode_t, mode);
}
return __syscall_open(file, flags, mode);
}
-libc_hidden_proto(__libc_open)
libc_hidden_def(__libc_open)
strong_alias(__libc_open,open)
-/* Copyright (C) 1991, 1995-1997, 1999, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <features.h>
#include <fcntl.h>
#include <stdarg.h>
+#ifdef __UCLIBC_HAS_LFS__
+
#ifndef O_LARGEFILE
-#define O_LARGEFILE 0100000
+# define O_LARGEFILE 0100000
#endif
-#ifdef __UCLIBC_HAS_LFS__
extern int __libc_open (__const char *__file, int __oflag, ...) __nonnull ((1));
libc_hidden_proto(__libc_open)
return __libc_open(file, oflag | O_LARGEFILE, mode);
}
-
strong_alias(__libc_open64,open64)
libc_hidden_proto(open64)
libc_hidden_def(open64)
/*
* pause() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* personality() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* pipe() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
-_syscall1(int, pipe, int *, filedes);
+
libc_hidden_proto(pipe)
+
+_syscall1(int, pipe, int *, filedes);
libc_hidden_def(pipe)
/*
* pivot_root() for uClibc
*
- * Copyright (C) 2000-2005 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include "syscalls.h"
#include <sys/poll.h>
+libc_hidden_proto(poll)
+
#ifdef __NR_poll
_syscall3(int, poll, struct pollfd *, fds,
unsigned long int, nfds, int, timeout);
}
#endif
-libc_hidden_proto(poll)
libc_hidden_def(poll)
* posix_fadvise() for uClibc
* http://www.opengroup.org/onlinepubs/009695399/functions/posix_fadvise.html
*
- * Copyright (C) 2000-2005 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
* posix_fadvise64() for uClibc
* http://www.opengroup.org/onlinepubs/009695399/functions/posix_fadvise.html
*
- * Copyright (C) 2000-2005 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <features.h>
/*
* prctl() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
-/* vi: set sw=4 ts=4:
+/* vi: set sw=4 ts=4: */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * Copyright (C) 2002 by Erik Andersen <andersen@uclibc.org>
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/*
* Based in part on the files
* ./sysdeps/unix/sysv/linux/pwrite.c,
* ./sysdeps/unix/sysv/linux/pread.c,
* sysdeps/posix/pread.c
* sysdeps/posix/pwrite.c
* from GNU libc 2.2.5, but reworked considerably...
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define _GNU_SOURCE
#include <unistd.h>
#include <stdint.h>
-libc_hidden_proto(read)
-libc_hidden_proto(write)
-
-#ifdef __UCLIBC_HAS_LFS__
-libc_hidden_proto(lseek64)
-#else
-libc_hidden_proto(lseek)
-#endif
-
#ifdef __NR_pread
#define __NR___syscall_pread __NR_pread
#if ! defined __NR_pread || ! defined __NR_pwrite
+libc_hidden_proto(read)
+libc_hidden_proto(write)
+libc_hidden_proto(lseek)
+libc_hidden_proto(lseek64)
+
static ssize_t __fake_pread_write(int fd, void *buf,
size_t count, off_t offset, int do_pwrite)
{
-/* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <errno.h>
#include <sys/types.h>
#include <sys/syscall.h>
#include <stdarg.h>
-
#define __NR___syscall_ptrace __NR_ptrace
-static _syscall4(long, __syscall_ptrace, enum __ptrace_request, request,
+static inline _syscall4(long, __syscall_ptrace, enum __ptrace_request, request,
__kernel_pid_t, pid, void*, addr, void*, data);
long int
/*
* query_module() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* quotactl() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* read() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* readlink() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
-_syscall3(int, readlink, const char *, path, char *, buf, size_t, bufsiz);
+
libc_hidden_proto(readlink)
+
+_syscall3(int, readlink, const char *, path, char *, buf, size_t, bufsiz);
libc_hidden_def(readlink)
/*
* readv() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* _reboot() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* rename() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* rmdir() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
-_syscall1(int, rmdir, const char *, pathname);
+
libc_hidden_proto(rmdir)
+
+_syscall1(int, rmdir, const char *, pathname);
libc_hidden_def(rmdir)
-/* Copyright (C) 1991, 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <unistd.h>
#include <errno.h>
+libc_hidden_proto(sbrk)
+
libc_hidden_proto(brk)
/* Defined in brk.c. */
return oldbrk;
}
-libc_hidden_proto(sbrk)
libc_hidden_def(sbrk)
/*
* sched_get_priority_max() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* sched_get_priority_min() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* sched_getparam() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* sched_getscheduler() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* sched_rr_get_interval() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* sched_setparam() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* sched_setscheduler() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* sched_yield() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* select() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
+libc_hidden_proto(select)
+
#ifdef __NR__newselect
-#undef __NR_select
-#define __NR_select __NR__newselect
+# undef __NR_select
+# define __NR_select __NR__newselect
#endif
_syscall5(int, select, int, n, fd_set *, readfds, fd_set *, writefds,
fd_set *, exceptfds, struct timeval *, timeout);
-libc_hidden_proto(select)
libc_hidden_def(select)
/*
* sendfile() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
- * sendfile64 syscall. Copes with 64 bit and 32 bit machines
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* sendfile64 syscall. Copes with 64 bit and 32 bit machines
* and on 32 bit machines this sends things into the kernel as
* two 32-bit arguments (high and low 32 bits of length) that
* are ordered based on endianess. It turns out endian.h has
* just the macro we need to order things, __LONG_LONG_PAIR.
- *
- * Copyright (C) 2002 Erik Andersen <andersen@codepoet.org>
- *
- * This file is subject to the terms and conditions of the GNU
- * Lesser General Public License. See the file COPYING.LIB in
- * the main directory of this archive for more details.
*/
#include <features.h>
#if defined __NR_sendfile64
-#if __WORDSIZE == 64 || (defined(__powerpc__) && defined (__UCLIBC_HAS_LFS__))
+# if __WORDSIZE == 64 || (defined(__powerpc__) && defined (__UCLIBC_HAS_LFS__))
/* For a 64 bit machine, life is simple... */
_syscall4(ssize_t,sendfile64, int, out_fd, int, in_fd, __off64_t *, offset, size_t, count);
-#elif __WORDSIZE == 32
+# elif __WORDSIZE == 32
-#if defined __UCLIBC_HAS_LFS__
+# if defined __UCLIBC_HAS_LFS__
_syscall4(ssize_t,sendfile64, int, out_fd, int, in_fd, __off64_t *, offset, size_t, count);
-#endif /* __UCLIBC_HAS_LFS__ */
+# endif /* __UCLIBC_HAS_LFS__ */
-#else /* __WORDSIZE */
-#error Your machine is not 64 bit or 32 bit, I am dazed and confused.
-#endif /* __WORDSIZE */
+# else /* __WORDSIZE */
+# error Your machine is not 64 bit or 32 bit, I am dazed and confused.
+# endif /* __WORDSIZE */
#else /* ! defined __NR_sendfile64 */
/*
* setdomainname() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <sys/types.h>
#include <sys/syscall.h>
+#ifdef __NR_setresgid
libc_hidden_proto(setresgid)
+#endif
libc_hidden_proto(setregid)
int setegid(gid_t gid)
#include <sys/types.h>
#include <sys/syscall.h>
+libc_hidden_proto(seteuid)
+
libc_hidden_proto(setresuid)
libc_hidden_proto(setreuid)
return result;
}
-libc_hidden_proto(seteuid)
libc_hidden_def(seteuid)
/*
* setfsgid() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* setfsuid() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* setgid() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* setgroups() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
#include <grp.h>
+libc_hidden_proto(setgroups)
+
libc_hidden_proto(sysconf)
#define __NR___syscall_setgroups __NR_setgroups
return i;
}
}
-libc_hidden_proto(setgroups)
libc_hidden_def(setgroups)
/*
* sethostname() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* setitimer() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <sys/time.h>
+
+libc_hidden_proto(setitimer)
+
_syscall3(int, setitimer, __itimer_which_t, which,
const struct itimerval *, new, struct itimerval *, old);
-libc_hidden_proto(setitimer)
libc_hidden_def(setitimer)
/*
* setpgid() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
+libc_hidden_proto(setpgid)
+
#define __NR___syscall_setpgid __NR_setpgid
static inline _syscall2(int, __syscall_setpgid,
__kernel_pid_t, pid, __kernel_pid_t, pgid);
{
return (__syscall_setpgid(pid, pgid));
}
-libc_hidden_proto(setpgid)
libc_hidden_def(setpgid)
/*
* setpriority() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <sys/resource.h>
-_syscall3(int, setpriority, __priority_which_t, which, id_t, who, int, prio);
+
libc_hidden_proto(setpriority)
+
+_syscall3(int, setpriority, __priority_which_t, which, id_t, who, int, prio);
libc_hidden_def(setpriority)
/*
* setregid() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
+libc_hidden_proto(setregid)
+
#define __NR___syscall_setregid __NR_setregid
static inline _syscall2(int, __syscall_setregid,
__kernel_gid_t, rgid, __kernel_gid_t, egid);
}
return (__syscall_setregid(rgid, egid));
}
-libc_hidden_proto(setregid)
libc_hidden_def(setregid)
/*
* setresgid() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
+#include <unistd.h>
#ifdef __NR_setresgid
+libc_hidden_proto(setresgid)
+
#define __NR___syscall_setresgid __NR_setresgid
static inline _syscall3(int, __syscall_setresgid,
__kernel_gid_t, rgid, __kernel_gid_t, egid, __kernel_gid_t, sgid);
}
return (__syscall_setresgid(rgid, egid, sgid));
}
-libc_hidden_proto(setresgid)
libc_hidden_def(setresgid)
#endif
/*
* setresuid() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
+#include <unistd.h>
#ifdef __NR_setresuid
+libc_hidden_proto(setresuid)
+
#define __NR___syscall_setresuid __NR_setresuid
static inline _syscall3(int, __syscall_setresuid,
__kernel_uid_t, rgid, __kernel_uid_t, egid, __kernel_uid_t, sgid);
}
return (__syscall_setresuid(ruid, euid, suid));
}
-libc_hidden_proto(setresuid)
libc_hidden_def(setresuid)
#endif
/*
* setreuid() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
+libc_hidden_proto(setreuid)
+
#define __NR___syscall_setreuid __NR_setreuid
static inline _syscall2(int, __syscall_setreuid,
__kernel_uid_t, ruid, __kernel_uid_t, euid);
}
return (__syscall_setreuid(ruid, euid));
}
-libc_hidden_proto(setreuid)
libc_hidden_def(setreuid)
/*
* setrlimit() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
+#include <unistd.h>
+#include <sys/resource.h>
+
+libc_hidden_proto(setrlimit)
#ifndef __NR_ugetrlimit
/* Only wrap setrlimit if the new ugetrlimit is not present */
#define __NR___syscall_setrlimit __NR_setrlimit
-#include <unistd.h>
-#include <sys/resource.h>
#define RMIN(x, y) ((x) < (y) ? (x) : (y))
static inline
_syscall2(int, __syscall_setrlimit, int, resource, const struct rlimit *, rlim);
#undef RMIN
#else /* We don't need to wrap setrlimit */
-
-#include <unistd.h>
-struct rlimit;
_syscall2(int, setrlimit, unsigned int, resource,
const struct rlimit *, rlim);
#endif
-
-libc_hidden_proto(setrlimit)
libc_hidden_def(setrlimit)
/*
* setsid() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
-_syscall0(pid_t, setsid);
+
libc_hidden_proto(setsid)
+
+_syscall0(pid_t, setsid);
libc_hidden_def(setsid)
/*
* settimeofday() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <sys/time.h>
-attribute_hidden _syscall2(int, settimeofday, const struct timeval *, tv,
- const struct timezone *, tz);
+
libc_hidden_proto(settimeofday)
+
+_syscall2(int, settimeofday, const struct timeval *, tv,
+ const struct timezone *, tz);
libc_hidden_def(settimeofday)
/*
* setuid() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* sigaltstack() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* sigpending() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#undef sigpending
#ifdef __NR_rt_sigpending
-#define __NR___rt_sigpending __NR_rt_sigpending
+# define __NR___rt_sigpending __NR_rt_sigpending
static inline _syscall2(int, __rt_sigpending, sigset_t *, set, size_t, size);
int sigpending(sigset_t * set)
{
return __rt_sigpending(set, _NSIG / 8);
}
-
#else
_syscall1(int, sigpending, sigset_t *, set);
#endif
/*
* sigprocmask() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#undef sigprocmask
+libc_hidden_proto(sigprocmask)
+
#ifdef __NR_rt_sigprocmask
-#define __NR___rt_sigprocmask __NR_rt_sigprocmask
+# define __NR___rt_sigprocmask __NR_rt_sigprocmask
static inline
_syscall4(int, __rt_sigprocmask, int, how, const sigset_t *, set,
sigset_t *, oldset, size_t, size);
int sigprocmask(int how, const sigset_t * set, sigset_t * oldset)
{
if (set &&
-#if (SIG_BLOCK == 0) && (SIG_UNBLOCK == 1) && (SIG_SETMASK == 2)
+# if (SIG_BLOCK == 0) && (SIG_UNBLOCK == 1) && (SIG_SETMASK == 2)
(((unsigned int) how) > 2)
-#else
-#warning "compile time assumption violated.. slow path..."
+# else
+# warning "compile time assumption violated.. slow path..."
((how != SIG_BLOCK) && (how != SIG_UNBLOCK)
&& (how != SIG_SETMASK))
-#endif
+# endif
) {
__set_errno(EINVAL);
return -1;
#else
-#define __NR___syscall_sigprocmask __NR_sigprocmask
+# define __NR___syscall_sigprocmask __NR_sigprocmask
static inline
_syscall3(int, __syscall_sigprocmask, int, how, const sigset_t *, set,
sigset_t *, oldset);
int sigprocmask(int how, const sigset_t * set, sigset_t * oldset)
{
if (set &&
-#if (SIG_BLOCK == 0) && (SIG_UNBLOCK == 1) && (SIG_SETMASK == 2)
+# if (SIG_BLOCK == 0) && (SIG_UNBLOCK == 1) && (SIG_SETMASK == 2)
(((unsigned int) how) > 2)
-#else
-#warning "compile time assumption violated.. slow path..."
+# else
+# warning "compile time assumption violated.. slow path..."
((how != SIG_BLOCK) && (how != SIG_UNBLOCK)
&& (how != SIG_SETMASK))
-#endif
+# endif
) {
__set_errno(EINVAL);
return -1;
return (__syscall_sigprocmask(how, set, oldset));
}
#endif
-
-libc_hidden_proto(sigprocmask)
libc_hidden_def(sigprocmask)
/*
* sigsuspend() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <signal.h>
#undef sigsuspend
+libc_hidden_proto(sigsuspend)
+
#ifdef __NR_rt_sigsuspend
-#define __NR___rt_sigsuspend __NR_rt_sigsuspend
+# define __NR___rt_sigsuspend __NR_rt_sigsuspend
static inline _syscall2(int, __rt_sigsuspend, const sigset_t *, mask, size_t, size);
int sigsuspend(const sigset_t * mask)
return __rt_sigsuspend(mask, _NSIG / 8);
}
#else
-#define __NR___syscall_sigsuspend __NR_sigsuspend
+# define __NR___syscall_sigsuspend __NR_sigsuspend
static inline _syscall3(int, __syscall_sigsuspend, int, a, unsigned long int, b,
unsigned long int, c);
return __syscall_sigsuspend(0, 0, set->__val[0]);
}
#endif
-libc_hidden_proto(sigsuspend)
libc_hidden_def(sigsuspend)
/*
* stat() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
/* need to hide the 64bit prototype or the weak_alias()
#undef stat64
+libc_hidden_proto(stat)
+
#define __NR___syscall_stat __NR_stat
#undef stat
static inline _syscall2(int, __syscall_stat,
}
return result;
}
-libc_hidden_proto(stat)
libc_hidden_def(stat)
#if ! defined __NR_stat64 && defined __UCLIBC_HAS_LFS__
/*
* stat64() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
+#include <sys/stat.h>
#if defined __UCLIBC_HAS_LFS__ && defined __NR_stat64
-#define __NR___syscall_stat64 __NR_stat64
-#include <unistd.h>
-#include <sys/stat.h>
-#include "xstatconv.h"
+libc_hidden_proto(stat64)
+
+# define __NR___syscall_stat64 __NR_stat64
+# include <unistd.h>
+# include <sys/stat.h>
+# include "xstatconv.h"
static inline _syscall2(int, __syscall_stat64,
const char *, file_name, struct kernel_stat64 *, buf);
}
return result;
}
-libc_hidden_proto(stat64)
libc_hidden_def(stat64)
-
-#endif /* __UCLIBC_HAS_LFS__ */
+#endif
/*
* statfs() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <sys/param.h>
#include <sys/vfs.h>
+libc_hidden_proto(statfs)
+
#define __NR___syscall_statfs __NR_statfs
static inline _syscall2(int, __syscall_statfs,
const char *, path, struct statfs *, buf);
{
return __syscall_statfs(path, buf);
}
-libc_hidden_proto(statfs)
libc_hidden_def(statfs)
/*
* swapoff() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* swapon() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* symlink() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* sync syscall for uClibc
*
- * Copyright (C) 2002 by Erik Andersen <andersen@codepoet.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#define _GNU_SOURCE
/*
* Common header file for uClibc syscalls
*
- * Copyright (C) 2001-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License
- * as published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#define _GNU_SOURCE
#undef __OPTIMIZE__
/* We absolutely do _NOT_ want interfaces silently
- * * * renamed under us or very bad things will happen... */
+ * being renamed under us or very bad things will happen... */
#ifdef __USE_FILE_OFFSET64
# undef __USE_FILE_OFFSET64
#endif
/*
* _sysctl() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* sysfs() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* sysinfo() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* time() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <time.h>
#include <sys/time.h>
+
+libc_hidden_proto(time)
+
#ifdef __NR_time
_syscall1(time_t, time, time_t *, t);
#else
return result;
}
#endif
-libc_hidden_proto(time)
libc_hidden_def(time)
/*
* times() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <sys/times.h>
-_syscall1(clock_t, times, struct tms *, buf);
+
libc_hidden_proto(times)
+
+_syscall1(clock_t, times, struct tms *, buf);
libc_hidden_def(times)
/*
* truncate() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
-_syscall2(int, truncate, const char *, path, __off_t, length);
+
libc_hidden_proto(truncate)
+
+_syscall2(int, truncate, const char *, path, __off_t, length);
libc_hidden_def(truncate)
/*
- * truncate64 syscall. Copes with 64 bit and 32 bit machines
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* truncate64 syscall. Copes with 64 bit and 32 bit machines
* and on 32 bit machines this sends things into the kernel as
* two 32-bit arguments (high and low 32 bits of length) that
* are ordered based on endianess. It turns out endian.h has
* just the macro we need to order things, __LONG_LONG_PAIR.
- *
- * Copyright (C) 2002 Erik Andersen <andersen@codepoet.org>
- *
- * This file is subject to the terms and conditions of the GNU
- * Lesser General Public License. See the file COPYING.LIB in
- * the main directory of this archive for more details.
*/
#include <features.h>
/* vi: set sw=4 ts=4: */
/*
- * Copyright (C) 2003 by Erik Andersen <andersen@codepoet.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#define _GNU_SOURCE
# undef __USE_FILE_OFFSET64
#endif
-
#ifdef __NR_ulimit
#include <sys/types.h>
/*
* umask() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* umount() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
-
/* arch provides umount() syscall */
#ifdef __NR_umount
-#include <sys/mount.h>
+# include <sys/mount.h>
_syscall1(int, umount, const char *, specialfile);
-
/* arch provides umount2() syscall */
#elif defined __NR_umount2
-#define __NR___syscall_umount2 __NR_umount2
+# define __NR___syscall_umount2 __NR_umount2
static inline _syscall2(int, __syscall_umount2, const char *, special_file, int, flags);
int umount(const char *special_file)
return (__syscall_umount2(special_file, 0));
}
-
/* arch doesn't provide any umount syscall !? */
#else
/*
* umount2() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* uname() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <sys/utsname.h>
-_syscall1(int, uname, struct utsname *, buf);
+
libc_hidden_proto(uname)
+
+_syscall1(int, uname, struct utsname *, buf);
libc_hidden_def(uname)
/*
* unlink() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
-_syscall1(int, unlink, const char *, pathname);
+
libc_hidden_proto(unlink)
+
+_syscall1(int, unlink, const char *, pathname);
libc_hidden_def(unlink)
/*
* uselib() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* ustat() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* utime() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <utime.h>
+
+libc_hidden_proto(utime)
+
#ifdef __NR_utime
attribute_hidden _syscall2(int, utime, const char *, file, const struct utimbuf *, times);
#else
return utimes(file, timevals);
}
#endif
-libc_hidden_proto(utime)
libc_hidden_def(utime)
/*
* utimes() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <utime.h>
+#include <sys/time.h>
+
+libc_hidden_proto(utimes)
+
#ifdef __NR_utimes
_syscall2(int, utimes, const char *, file, const struct timeval *, tvp);
#else
return utime(file, times);
}
#endif
-libc_hidden_proto(utimes)
libc_hidden_def(utimes)
#include <unistd.h>
#include <sys/types.h>
+libc_hidden_proto(vfork)
+
libc_hidden_proto(fork)
pid_t vfork(void)
{
return fork();
}
-libc_hidden_proto(vfork)
libc_hidden_def(vfork)
/*
* vhangup() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* wait4() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
+#include <sys/wait.h>
#include <sys/resource.h>
+libc_hidden_proto(wait4)
+
#define __NR___syscall_wait4 __NR_wait4
static inline _syscall4(int, __syscall_wait4, __kernel_pid_t, pid,
int *, status, int, opts, struct rusage *, rusage);
{
return (__syscall_wait4(pid, status, opts, rusage));
}
-libc_hidden_proto(wait4)
libc_hidden_def(wait4)
/*
* write() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
* writev() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
/*
- * Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvs/uClibc/libc/sysdeps/linux/common/xattr.c,v 1.2 2004/12/22 19:53:11 andersen Exp $
+ * Copyright (C) 2004 <solar@gentoo.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * This file provides the following Extended Attribute system calls to uClibc.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* This file provides the following Extended Attribute system calls to uClibc.
*
* setxattr(), lsetxattr(), fsetxattr(),
* getxattr(), lgetxattr(), fgetxattr(),
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include <features.h>
#include <sysdep.h>
#define _SETJMP_H
#define _ASM
movem [$r10],$pc
END (__longjmp)
- .weak longjmp
- longjmp = __longjmp
-
+libc_hidden_def(__longjmp)
+strong_alias(__longjmp,longjmp)
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
#include <unistd.h>
#include <sys/syscall.h>
#include <errno.h>
#include "sysdep.h"
+libc_hidden_proto(brk)
+
extern void * __curbrk;
extern int __init_brk (void);
return -1;
}
-libc_hidden_proto(brk)
libc_hidden_def(brk)
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
#include <sysdep.h>
#define __NR___libc_fork __NR_fork
/* From libc-5.3.12 */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <unistd.h>
#include <sys/syscall.h>
#include <errno.h>
#include "sysdep.h"
+libc_hidden_proto(sbrk)
+
extern void * __curbrk;
extern int __init_brk (void);
}
return ((void *) -1);
}
-libc_hidden_proto(sbrk)
libc_hidden_def(sbrk)
-/* This file is lisenced under LGPL
- * Copyright (C) 2002-2003, George Thanos <george.thanos@gdt.gr>
- * Yannis Mitsos <yannis.mitsos@gdt.gr>
+/*
+ * Copyright (C) 2002-2003, George Thanos <george.thanos@gdt.gr>
+ * Yannis Mitsos <yannis.mitsos@gdt.gr>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <syscall.h>
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
#include <sys/types.h>
#include <sys/syscall.h>
#include <errno.h>
+libc_hidden_proto(vfork)
+
_syscall0(pid_t, vfork);
+libc_hidden_def(vfork)
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
#define _SETJMP_H
#define _ASM
#include <bits/setjmp.h>
ret
.Lend2:
.size __longjmp,.Lend2-__longjmp
+
+libc_hidden_def(__longjmp)
/* From libc-5.3.12 */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <errno.h>
#include <unistd.h>
#include <sys/syscall.h>
+libc_hidden_proto(brk)
+
extern void * __curbrk;
extern int __init_brk (void);
}
return -1;
}
-libc_hidden_proto(brk)
libc_hidden_def(brk)
/*
* Syscalls for uClibc
*
- * Copyright (C) 2001-2003 by Erik Andersen
- * Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
- * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
+ * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
*/
#define _GNU_SOURCE
#include <bits/stat.h>
#define __NR___syscall_fstat __NR_fstat
-attribute_hidden _syscall2(int, __syscall_fstat, int, fd, struct stat *, buf);
+static inline _syscall2(int, __syscall_fstat, int, fd, struct stat *, buf);
strong_alias(__syscall_fstat,fstat)
libc_hidden_proto(fstat)
libc_hidden_def(fstat)
/*
* Syscalls for uClibc
*
- * Copyright (C) 2001-2003 by Erik Andersen
- * Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
- * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
+ * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
*/
#define _GNU_SOURCE
#if defined __UCLIBC_HAS_LFS__
#define __NR___syscall_fstat64 __NR_fstat64
-attribute_hidden _syscall2(int, __syscall_fstat64, int, fd, struct stat64 *, buf);
+static inline _syscall2(int, __syscall_fstat64, int, fd, struct stat64 *, buf);
strong_alias(__syscall_fstat64,fstat64)
libc_hidden_proto(fstat64)
libc_hidden_def(fstat64)
/*
* Syscalls for uClibc
*
- * Copyright (C) 2001-2003 by Erik Andersen
- * Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
- * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
+ * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
*/
#define _GNU_SOURCE
#include <bits/stat.h>
#define __NR___syscall_lstat __NR_lstat
-attribute_hidden _syscall2(int, __syscall_lstat, const char *, file_name, struct stat *, buf);
+static inline _syscall2(int, __syscall_lstat, const char *, file_name, struct stat *, buf);
strong_alias(__syscall_lstat,lstat)
libc_hidden_proto(lstat)
libc_hidden_def(lstat)
/*
* Syscalls for uClibc
*
- * Copyright (C) 2001-2003 by Erik Andersen
- * Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
- * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
+ * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
*/
#define _GNU_SOURCE
#if defined __UCLIBC_HAS_LFS__
#define __NR___syscall_lstat64 __NR_lstat64
-attribute_hidden _syscall2(int, __syscall_lstat64, const char *, file_name, struct stat64 *, buf);
+static inline _syscall2(int, __syscall_lstat64, const char *, file_name, struct stat64 *, buf);
strong_alias(__syscall_lstat64,lstat64)
libc_hidden_proto(lstat64)
libc_hidden_def(lstat64)
#include <sys/syscall.h>
#include <sys/mman.h>
+libc_hidden_proto(mmap)
+
#define __NR___syscall_mmap2 __NR_mmap2
static inline _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr,
size_t, len, int, prot, int, flags, int, fd, off_t, offset);
}
return(__syscall_mmap2(addr, len, prot, flags, fd, (off_t) (offset >> MMAP2_PAGE_SHIFT)));
}
-libc_hidden_proto(mmap)
libc_hidden_def(mmap)
#include <unistd.h>
#include <sys/syscall.h>
+libc_hidden_proto(sbrk)
+
extern void * __curbrk;
extern int __init_brk (void);
}
return ((void *) -1);
}
-libc_hidden_proto(sbrk)
libc_hidden_def(sbrk)
/*
* Syscalls for uClibc
*
- * Copyright (C) 2001-2003 by Erik Andersen
- * Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
- * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
+ * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
*/
#define _GNU_SOURCE
#include <bits/stat.h>
#define __NR___syscall_stat __NR_stat
-attribute_hidden _syscall2(int, __syscall_stat, const char *, file_name, struct stat *, buf);
+static inline _syscall2(int, __syscall_stat, const char *, file_name, struct stat *, buf);
strong_alias(__syscall_stat,stat)
libc_hidden_proto(stat)
libc_hidden_def(stat)
/*
* Syscalls for uClibc
*
- * Copyright (C) 2001-2003 by Erik Andersen
- * Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
- * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Extracted from ../common/syscalls.c by Erik Andersen <andersen@codepoet.org>
+ * Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
*/
#define _GNU_SOURCE
#if defined __UCLIBC_HAS_LFS__
#define __NR___syscall_stat64 __NR_stat64
-attribute_hidden _syscall2(int, __syscall_stat64, const char *, file_name, struct stat64 *, buf);
+static inline _syscall2(int, __syscall_stat64, const char *, file_name, struct stat64 *, buf);
strong_alias(__syscall_stat64,stat64)
libc_hidden_proto(stat64)
libc_hidden_def(stat64)
/* brk on H8/300 by ysato */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <errno.h>
#include <unistd.h>
#include <sys/syscall.h>
+libc_hidden_proto(brk)
/* This must be initialized data because commons can't have aliases. */
void *__curbrk = 0;
-
int brk (void *addr)
{
void *newbrk;
return 0;
}
-libc_hidden_proto(brk)
libc_hidden_def(brk)
sub.l er0,er0
dec.l #1,er0
jmp @er1 /* don't return, just jmp directly */
-
-libc_hidden_def(_vork)
/* Wrapper for setting errno.
- Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <errno.h>
#include <features.h>
#include <errno.h>
#include <sys/syscall.h>
+libc_hidden_proto(brk)
+
/* This must be initialized data because commons can't have aliases. */
void *__curbrk = 0;
return 0;
}
-libc_hidden_proto(brk)
libc_hidden_def(brk)
/*
* mmap() for uClibc/x86_64
*
- * Copyright (C) 2005 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
* Copyright (C) 2005 by Mike Frysinger <vapier@gentoo.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <errno.h>
#include <sys/mman.h>
#include <sys/syscall.h>
+libc_hidden_proto(mmap)
+
_syscall6(void *, mmap, void *, start, size_t, length, int, prot,
int, flags, int, fd, off_t, offset);
-libc_hidden_proto(mmap)
libc_hidden_def(mmap)
/* Wrapper for setting errno.
- Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <errno.h>
-#include <features.h>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
/* This routine is jumped to by all the syscall handlers, to stash
* an error number into errno. */
* We have to stash the errno from %eax in a local stack var because
* __set_errno will prob call a function thus clobbering %eax on us.
*/
+
+#include <errno.h>
+#include <features.h>
+
int attribute_hidden __syscall_error(void)
{
register int edx asm("%edx");
#include <unistd.h>
#include <sys/syscall.h>
+libc_hidden_proto(brk)
/* This must be initialized data because commons can't have aliases. */
void *__curbrk = 0;
return 0;
}
-libc_hidden_proto(brk)
libc_hidden_def(brk)
/* Wrapper for setting errno.
- Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <errno.h>
#include <features.h>
/* consider this code LGPL - davidm */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <unistd.h>
#include <sys/syscall.h>
#include <errno.h>
+libc_hidden_proto(brk)
+
/* This must be initialized data because commons can't have aliases. */
void * __curbrk = 0;
return 0;
}
-libc_hidden_proto(brk)
libc_hidden_def(brk)
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <errno.h>
#include <asm/ptrace.h>
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
#include <features.h>
#include <asm/unistd.h>
.weak C_SYMBOL_NAME(__sigprocmask)
C_SYMBOL_NAME(__sigprocmask) = C_SYMBOL_NAME(sigprocmask)
-
-libc_hidden_def(__longjmp)
/* Use new style mmap for microblaze */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <unistd.h>
#include <errno.h>
#include <sys/mman.h>
#include <sys/syscall.h>
+libc_hidden_proto(mmap)
+
_syscall6 (__ptr_t, mmap, __ptr_t, addr, size_t, len, int, prot,
int, flags, int, fd, __off_t, offset);
-libc_hidden_proto(mmap)
libc_hidden_def(mmap)
rtsd r15, 8 // error return
nop
C_END(vfork)
-
-libc_hidden_def(vfork)
#undef __longjmp
+libc_hidden_proto(__longjmp)
+
#ifndef __GNUC__
#error This file uses GNU C extensions; you must compile with GCC.
#endif
/* Avoid `volatile function does return' warnings. */
for (;;);
}
-libc_hidden_proto(__longjmp)
libc_hidden_def(__longjmp)
/* Wrapper for setting errno.
- Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <errno.h>
#include <features.h>
#include <unistd.h>
#include <sys/syscall.h>
+libc_hidden_proto(brk)
+
void *__curbrk = 0;
int brk (void *addr)
return 0;
}
-libc_hidden_proto(brk)
libc_hidden_def(brk)
#include <sys/syscall.h>
_syscall3(int, cacheflush, void *, addr, const int, nbytes, const int, op);
-weak_alias(cacheflush, _flush_cache)
+strong_alias(cacheflush, _flush_cache)
_syscall3(int, cachectl, void *, addr, const int, nbytes, const int, op);
/* Use new style mmap for mips */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
#include <unistd.h>
#include <errno.h>
#include <sys/mman.h>
#include <sys/syscall.h>
+libc_hidden_proto(mmap)
+
#if 0
/* For now, leave mmap using mmap1 since mmap2 seems
* to have issues (i.e. it doesn't work 100% properly).
_syscall6 (__ptr_t, mmap, __ptr_t, addr, size_t, len, int, prot,
int, flags, int, fd, __off_t, offset);
-libc_hidden_proto(mmap)
libc_hidden_def(mmap)
/* pipe system call for Linux/MIPS */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
/*see uClibc's sh/pipe.c and glibc-2.2.4's mips/pipe.S */
/* pipe system call for Linux/MIPS */
-
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
/*see uClibc's sh/pipe.c and glibc-2.2.4's mips/pipe.S */
#include <errno.h>
#include <unistd.h>
#include <syscall.h>
+libc_hidden_proto(pipe)
+
int pipe(int *fd)
{
register long int res __asm__ ("$2"); // v0
fd[1] = res2;
return(0);
}
-libc_hidden_proto(pipe)
libc_hidden_def(pipe)
/* vi: set sw=4 ts=4:
*
- * Copyright (C) 2002 by Erik Andersen <andersen@uclibc.org>
- * Based in part on the files
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Based in part on the files
* ./sysdeps/unix/sysv/linux/pwrite.c,
* ./sysdeps/unix/sysv/linux/pread.c,
* sysdeps/posix/pread.c
* sysdeps/posix/pwrite.c
* from GNU libc 2.2.5, but reworked considerably...
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define _GNU_SOURCE
#include <sys/syscall.h>
#include <errno.h>
+libc_hidden_proto(brk)
/* This must be initialized data because commons can't have aliases. */
void *__curbrk = 0;
return 0;
}
-libc_hidden_proto(brk)
libc_hidden_def(brk)
#include <sys/syscall.h>
#include <errno.h>
+libc_hidden_proto(brk)
/* This must be initialized data because commons can't have aliases. */
void *__curbrk = 0;
return 0;
}
-libc_hidden_proto(brk)
libc_hidden_def(brk)
/*
* libc/sysdeps/linux/nios2/clone.c -- `clone' syscall for linux/nios2
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
*
* Copyright (C) 2004,05 Microtronix Datacom Ltd
* Copyright (C) 2002,03 NEC Electronics Corporation
* Copyright (C) 2002,03 Miles Bader <miles@gnu.org>
*
- * This file is subject to the terms and conditions of the GNU Lesser
- * General Public License. See the file COPYING.LIB in the main
- * directory of this archive for more details.
- *
* Written by Miles Bader <miles@gnu.org>
* Nios2 port by Wentao Xu
*/
/* Wrapper for setting errno.
- Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <errno.h>
#include <features.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
+libc_hidden_proto(ioctl)
+
libc_hidden_proto(tcsetattr)
libc_hidden_proto(tcgetattr)
return result;
}
-libc_hidden_proto(ioctl)
libc_hidden_def(ioctl)
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <unistd.h>
#include <sys/mman.h>
#include <errno.h>
#include <sys/syscall.h>
+libc_hidden_proto(mmap)
+
#define __syscall_clobbers \
"r9", "r10", "r11", "r12"
#define __syscall_return(type) \
__syscall_return (void *);
}
-libc_hidden_proto(mmap)
libc_hidden_def(mmap)
/* vi: set sw=4 ts=4:
*
- * Copyright (C) 2002 by Erik Andersen <andersen@uclibc.org>
- * Based in part on the files
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Based in part on the files
* ./sysdeps/unix/sysv/linux/pwrite.c,
* ./sysdeps/unix/sysv/linux/pread.c,
* sysdeps/posix/pread.c
* sysdeps/posix/pwrite.c
* from GNU libc 2.2.5, but reworked considerably...
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define _GNU_SOURCE
#if ! defined __NR_pread || ! defined __NR_pwrite
-libc_hidden_proto(lseek)
-libc_hidden_proto(lseek64)
libc_hidden_proto(read)
libc_hidden_proto(write)
+libc_hidden_proto(lseek)
+libc_hidden_proto(lseek64)
static ssize_t __fake_pread_write(int fd, void *buf,
size_t count, off_t offset, int do_pwrite)
#include <errno.h>
#include <sys/syscall.h>
+libc_hidden_proto(vfork)
+
#define __syscall_clobbers \
"r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12"
#define __syscall_return(type) \
__syscall_return (pid_t);
}
-libc_hidden_proto(vfork)
libc_hidden_def(vfork)
.size __longjmp,.-__longjmp
libc_hidden_def(__longjmp)
+/* sigprocmask is not defined here, why the weak then ?*/
+/* it should rather be libc_hidden_def(sigprocmask) if needed */
.weak __sigprocmask
__sigprocmask = sigprocmask
/* From libc-5.3.12 */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <errno.h>
#include <unistd.h>
#include <sys/syscall.h>
+libc_hidden_proto(brk)
+
extern void * __curbrk;
extern int __init_brk (void);
}
return -1;
}
-libc_hidden_proto(brk)
libc_hidden_def(brk)
#include <errno.h>
#include <sys/mman.h>
+libc_hidden_proto(mmap)
+
#ifdef HIOS
# define __SH_SYSCALL6_TRAPA "0x2E"
#else
#include <sys/syscall.h>
_syscall6(__ptr_t, mmap, __ptr_t, addr, size_t, len, int, prot, int, flags, int, fd, __off_t, offset);
-libc_hidden_proto(mmap)
libc_hidden_def(mmap)
-
-/* Copyright (C) 2001 Lineo, <davidm@lineo.com> */
+/*
+ * Copyright (C) 2001 Lineo, <davidm@lineo.com>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <errno.h>
#include <unistd.h>
#include <syscall.h>
+libc_hidden_proto(pipe)
+
int pipe(int *fd)
{
long __res, __res2;
fd[1] = __res2;
return(0);
}
-libc_hidden_proto(pipe)
libc_hidden_def(pipe)
/* vi: set sw=4 ts=4:
*
- * Copyright (C) 2002 by Erik Andersen <andersen@uclibc.org>
- * Based in part on the files
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Based in part on the files
* ./sysdeps/unix/sysv/linux/pwrite.c,
* ./sysdeps/unix/sysv/linux/pread.c,
* sysdeps/posix/pread.c
* sysdeps/posix/pwrite.c
* from GNU libc 2.2.5, but reworked considerably...
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define _GNU_SOURCE
#include <unistd.h>
#include <sys/syscall.h>
+libc_hidden_proto(sbrk)
+
extern void * __curbrk;
extern int __init_brk (void);
}
return ((void *) -1);
}
-libc_hidden_proto(sbrk)
libc_hidden_def(sbrk)
/* From libc-5.3.12 */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <errno.h>
#include <unistd.h>
#include <sys/syscall.h>
+libc_hidden_proto(brk)
+
extern void * __curbrk;
extern int __init_brk (void);
}
return -1;
}
-libc_hidden_proto(brk)
libc_hidden_def(brk)
#include <unistd.h>
#include <sys/syscall.h>
+libc_hidden_proto(sbrk)
+
extern void * __curbrk;
extern int __init_brk (void);
extern void *_brk(void *ptr) attribute_hidden;
-void attribute_hidden *
-__sbrk(intptr_t increment)
+void *
+sbrk(intptr_t increment)
{
if (__init_brk () == 0)
{
}
return ((void *) -1);
}
-strong_alias(__sbrk,sbrk)
+libc_hidden_def(sbrk)
/* Wrapper for setting errno.
- Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <errno.h>
#include <features.h>
#include <unistd.h>
#include <sys/syscall.h>
+libc_hidden_proto(brk)
/* This must be initialized data because commons can't have aliases. */
void *__curbrk = 0;
-
int brk (void *addr)
{
void *newbrk;
return 0;
}
-libc_hidden_proto(brk)
libc_hidden_def(brk)
.weak C_SYMBOL_NAME(__sigprocmask)
C_SYMBOL_NAME(__sigprocmask) = C_SYMBOL_NAME(sigprocmask)
-libc_hidden_def(__longjmp)
/* Use new style mmap for v850 */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <unistd.h>
#include <errno.h>
#include <sys/mman.h>
#include <sys/syscall.h>
+libc_hidden_proto(mmap)
+
_syscall6 (__ptr_t, mmap, __ptr_t, addr, size_t, len, int, prot,
int, flags, int, fd, __off_t, offset);
-libc_hidden_proto(mmap)
libc_hidden_def(mmap)
st.w r10, 0[r11]
jmp [lp] // error return
C_END(vfork)
-
-libc_hidden_def(vfork)
/* Wrapper for setting errno.
- Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <errno.h>
#include <features.h>
#include <unistd.h>
#include <sys/syscall.h>
+libc_hidden_proto(brk)
+
/* This must be initialized data because commons can't have aliases. */
void *__curbrk = 0;
return 0;
}
-libc_hidden_proto(brk)
libc_hidden_def(brk)
/*
* mmap() for uClibc/x86_64
*
- * Copyright (C) 2005 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
* Copyright (C) 2005 by Mike Frysinger <vapier@gentoo.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <errno.h>
#include <sys/mman.h>
#include <sys/syscall.h>
+libc_hidden_proto(mmap)
+
_syscall6(void *, mmap, void *, start, size_t, length, int, prot,
int, flags, int, fd, off_t, offset);
-libc_hidden_proto(mmap)
libc_hidden_def(mmap)
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
libc_hidden_proto(strcpy)
libc_hidden_proto(strncpy)
* the user specify whatever they want via the LOGNAME environment
* variable, or we return NULL if getenv() fails to find anything */
+libc_hidden_proto(getlogin)
char * getlogin(void)
{
return (getenv("LOGNAME"));
}
-libc_hidden_proto(getlogin)
libc_hidden_def(getlogin)
int getlogin_r(char *name, size_t len)
#include <regex.h>
#endif
+libc_hidden_proto(sysconf)
+
libc_hidden_proto(getpagesize)
libc_hidden_proto(getdtablesize)
#endif
}
}
-libc_hidden_proto(sysconf)
libc_hidden_def(sysconf)