2
* (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
3
* All rights reserved. The file named COPYRIGHT specifies the terms
4
* and conditions for redistribution.
15
#include "libportable.h"
18
* Search the given buffer for an occurrence of "%m"
20
int __xlog_add_errno( const char *buf, int len )
24
for ( i = 0 ; i < len-1 ; i++ )
25
if ( (buf[i] == '%') && (buf[i+1] == 'm') )
30
/* __xlog_explain_errno:
31
* Description: generates a string to explain the value of errno.
32
* On entry: buf must point to space already allocated by the caller,
33
* and size points to the amount of memory buf is allocated.
34
* On exit: buf contains the NULL terminated string, size now points
35
* to the length of the string, and the return value is buf.
37
char *__xlog_explain_errno( char *buf, unsigned *size )
39
strx_print((int *)size, buf, *size, "%s (errno = %d)",
40
strerror(errno), errno);
45
char *__xlog_new_string( const char *s )