Revision 9bb57c0b119ee75c9e49842a686c0ca07970e37c authored by Colin Percival on 25 January 2010, 23:48:47 UTC, committed by Colin Percival on 25 January 2010, 23:48:47 UTC
to HEAD in r185029; but this is an "inspired by" commit rather than a
literal merge, since this region of code in HEAD has other non-MFCable
changes.

The namei lookups this unbreaks are required for ZFS extended attributes;
prior to this commit, an attempt to look up (list, read, write, delete)
extended attributes would be handled as an attempt to look up a file in
the current directory if an extended attribute directory existed ("at vp"
was mishandled as "right here").

Reviewed by:	jhb
Approved by:	re (kib)
Found by:	Henrik Wiest & libarchive
1 parent 0ddd204
Raw File
os.h
#include <sys/types.h>
#include <sys/param.h>	/* This defines BSD */
#if defined(BSD) && !defined(BSD4_4) && !defined(__osf__)
# include <stdio.h>
# include <strings.h>
# define strchr(a, b)		index((a), (b))
# define strrchr(a, b)		rindex((a), (b))
# define memcpy(a, b, c)	bcopy((b), (a), (c))
# define memzero(a, b)		bzero((a), (b))
# define memcmp(a, b, c)	bcmp((a), (b), (c))
#if defined(NeXT)
  typedef void sigret_t;
#else
  typedef int sigret_t;
#endif

/* system routines that don't return int */
char *getenv();
caddr_t malloc();

#else 
# include <stdio.h>
# define setbuffer(f, b, s)	setvbuf((f), (b), (b) ? _IOFBF : _IONBF, (s))
# include <string.h>
# include <memory.h>
# include <stdlib.h>
# define memzero(a, b)		memset((a), 0, (b))
  typedef void sigret_t;
#endif

/* some systems declare sys_errlist in stdio.h! */
#if defined(__NetBSD__) || defined(__FreeBSD__)
#if !defined(__m68k__)
#  if !defined(__NetBSD132__)
#define SYS_ERRLIST_DECLARED
#  endif	/* __NetBSD132__ */
#endif
#endif
back to top