/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Portions of this source code were derived from Berkeley 4.3 BSD
* under license from the Regents of the University of California.
*/
#include <sys/isa_defs.h>
#include <sys/inttypes.h>
#include <sys/sysmacros.h>
#if defined(_SYSCALL32_IMPL) || defined(_ILP32)
/*
* Get directory entries in a file system-independent format.
*
* The 32-bit version of this function now allocates a buffer to grab the
* directory entries in dirent64 formats from VOP_READDIR routines.
* The dirent64 structures are converted to dirent32 structures and
* copied to the user space.
*
* Both 32-bit and 64-bit versions of libc use getdents64() and therefore
* we don't expect any major performance impact due to the extra kmem_alloc's
* and copying done in this routine.
*/
/*
* Native 32-bit system call for non-large-file applications.
*/
int
{
register int error;
int sink;
char *newbuf;
char *obuf;
int bufsize;
}
}
/*
* Don't let the user overcommit kernel resources.
*/
if (count > MAXGETDENTS_SIZE)
if (error)
goto out;
osize = 0;
nsize = 0;
/*
* This check ensures that the 64 bit d_ino and d_off
* fields will fit into their 32 bit equivalents.
*
* Although d_off is a signed value, the check is done
* against the full 32 bits because certain file systems,
* NFS for one, allow directory cookies to use the full
* 32 bits. We use uint64_t because there is no exact
* unsigned analog to the off64_t type of dp->d_off.
*/
goto out;
}
/* use strncpy(9f) to zero out uninitialized bytes */
}
out:
if (error) {
}
return (osize);
}
#endif /* _SYSCALL32 || _ILP32 */
int
{
register int error;
int sink;
/*
* Don't let the user overcommit kernel resources.
*/
if (count > MAXGETDENTS_SIZE)
}
}
if (error) {
}
return (count);
}