04-28-2005
One would assume you've tried the obvious - 'man getdents' ?
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi there,
I'm investigating migrating a system currently running Scos osr5 to Linux (eg RH 7.2) but there are a lot of in house scripts, some of which are probably using "Sco specific" constructs etc. One I have come across is as follows,
if ????? ]
then ....etc.etc
fi
The regular... (2 Replies)
Discussion started by: pcs7088
2 Replies
2. Shell Programming and Scripting
I want to find out Row which starts with, the user specified details to a script.
In general I know what command to be given.
awk '$0~/^Vi/' BReject
But I need to pass on $1 param of command line at the place of 'Vi'.
I tried with -v subst=$1
awk -v subst=$1 '$0~/^subst/' BReject
But it... (5 Replies)
Discussion started by: videsh77
5 Replies
3. UNIX for Dummies Questions & Answers
hi frnds,
i need all ur help guys..
I am facing problem when i give script < file name> command
whenever i give this command,i get an error message indicating
"Openpty failed.
Terminated"
:confused:
can u help me out...
with regds,
Deep (7 Replies)
Discussion started by: deep
7 Replies
4. Shell Programming and Scripting
I am using the mailx command of Unix through which I am able send mails but the problem is the from mail ID is automatically buit by unix as the (UNIX Box Name:---------------------------------) to mask the from id the option used by mailx is -r but for some security reasons this is blocked by the... (1 Reply)
Discussion started by: naren_chella
1 Replies
5. Solaris
Am new to solaris can anyone explain the fields in the below command. Also let me know the difference between nodename and hostname. Here osnask2 is the hostname and type SUNOS. What abt the remaining fields.?
#uname -a
SunOS osnska2 5.8 Generic_117350-47 sun4u sparc SUNW,Sun-Fire-480R (1 Reply)
Discussion started by: rogerben
1 Replies
6. Linux
Hi Guys,
I had a small task to install linux using Kickstart(Remote Installation) in sun x4450 server. Any document with screen shot for linux installation. please assist me, Thanks in Advance.
specifications
2* Quad core 2.93 ghz cpu
32 gb
4 * 146 gb harddisk (1 Reply)
Discussion started by: kurva
1 Replies
7. Solaris
Hi,
Can anyone explain me what is RSS time in the prstat output.
In the below example 93M is total process size(correct me if am wrong ) what abt 58M?
1693 root 93M 58M cpu1 0 10 4:11:02 0.8% java/35 (2 Replies)
Discussion started by: rogerben
2 Replies
8. Solaris
Hi,
Am trying to send mail from solaris host to my mailbox, but while executing mailx command am getting the follow error.Is this syntax corect?
#mailx -s "subject" <myid>
The flags you gave are used only when sending mail. (1 Reply)
Discussion started by: rogerben
1 Replies
9. Shell Programming and Scripting
Hi,
Can anyone point out some examples on how to use sendmail to send mails with attachments. We have a requirement to change from address and so we are not able to use uuencode along with mailx for sending emails. All your reponses are highly appreciated.
Thanks,
Manick. (3 Replies)
Discussion started by: manickaraja
3 Replies
10. Shell Programming and Scripting
Dear community,
I am trying for several hours now to create an egrep command to grep the number of lines containing a specific text from a text-file but seem to have an error somewhere.
The Textfile contains several thousand lines and has the expression "Lastname" in several lines.... (3 Replies)
Discussion started by: Donzo
3 Replies
READDIR(2) Linux Programmer's Manual READDIR(2)
NAME
readdir - read directory entry
SYNOPSIS
int readdir(unsigned int fd, struct old_linux_dirent *dirp,
unsigned int count);
DESCRIPTION
This is not the function you are interested in. Look at readdir(3) for the POSIX conforming C library interface. This page documents the
bare kernel system call interface, which is superseded by getdents(2).
readdir() reads one old_linux_dirent structure from the directory referred to by the file descriptor fd into the buffer pointed to by dirp.
The argument count is ignored; at most one old_linux_dirent structure is read.
The old_linux_dirent structure is declared as follows:
struct old_linux_dirent {
long d_ino; /* inode number */
off_t d_off; /* offset to this old_linux_dirent */
unsigned short d_reclen; /* length of this d_name */
char d_name[NAME_MAX+1]; /* filename (null-terminated) */
}
d_ino is an inode number. d_off is the distance from the start of the directory to this old_linux_dirent. d_reclen is the size of d_name,
not counting the null terminator. d_name is a null-terminated filename.
RETURN VALUE
On success, 1 is returned. On end of directory, 0 is returned. On error, -1 is returned, and errno is set appropriately.
ERRORS
EBADF Invalid file descriptor fd.
EFAULT Argument points outside the calling process's address space.
EINVAL Result buffer is too small.
ENOENT No such directory.
ENOTDIR
File descriptor does not refer to a directory.
CONFORMING TO
This system call is Linux-specific.
NOTES
Glibc does not provide a wrapper for this system call; call it using syscall(2). You will need to define the old_linux_dirent structure
yourself.
SEE ALSO
getdents(2), readdir(3)
COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2008-10-02 READDIR(2)