10-25-2005
pread & pwrite are for raw I/O to character devices.
lread & lwrit are I/O to the buffer, not disk
logical read/write means that the I/O was done to a buffer, ie., memory.
Physical I/O is to a device - tty, disk, tape.
The more use the system gets from buffers, the more efficient overall I/O throughput becomes.
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I executed the following command in the korn shell:
$ variable1="qwerty" ls | sort
and the shell executed the 'ls | sort' command.
I would have expected an error message from the shell, but instead of that the shell ran the 'ls | sort' command and didn't realize the variable assignement. ... (1 Reply)
Discussion started by: PhilippeCrokaer
1 Replies
2. AIX
hello
with a sar i have this result:
System configuration: lcpu=48 ent=4.00
14:06:37 %usr %sys %wio %idle physc %entc
14:06:39 26 9 3 62 1.63 40.7
14:06:41 26 9 3 63 1.58 39.4
14:06:43 ... (0 Replies)
Discussion started by: pascalbout
0 Replies
3. IP Networking
Hi Guys,
This is really really urgent. Am looking out for some quick answers.
I'm developing a DNS Resolver client that interprets DNS Query repsonses & pass on the needful to DNS applications.
When an ENUM query(modified to an nslookup naptr query) is issued & an NAPTR RR(Resource Record)... (1 Reply)
Discussion started by: smanu
1 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I get the message NOTICE HTFS :No Space on dev hd (1/104), What does (1/104) mean? Is there any link, I can get material on understanding unix message log?
thanks. (4 Replies)
Discussion started by: scomrade
4 Replies
5. Solaris
Hi
What means Solaris 10 5/09 and Solaris 10 10/09, I mean the suffix 5/09 and 10/09 ?
thx for help. (1 Reply)
Discussion started by: presul
1 Replies
6. Shell Programming and Scripting
I'm writing a Korn script but am having trouble because the shell interprets the asterisk in this case. Can anyone tell me if there is a way to fix this so that grep takes in STDIN without the interpretation?
line="30 09 * * 1-4 /home/user01/bin/start"
echo "$line" | grep 'start' (16 Replies)
Discussion started by: sprucio
16 Replies
7. AIX
On my VIo I see the following for my disks:
$ lspath | grep hdisk6
Enabled hdisk6 fscsi0 200600a0b82193f7,4000000000000
Enabled hdisk6 fscsi0 200700a0b82193f7,4000000000000
Enabled hdisk6 fscsi2 200600a0b82193f8,4000000000000
Failed hdisk6 fscsi2 200700a0b82193f8,4000000000000
$ lspath |... (8 Replies)
Discussion started by: petervg
8 Replies
8. UNIX for Advanced & Expert Users
hi, anyone can help on this piece of truss output?
8094: 0.7028 write(4, 0x0043BE90, 236) = 236
8094: T S H \0\0\0EC020101\0\0\0\0\0\0\0\0\0 "02\0\0 303\0\0 I D
8094: \f %\0\0\0\0 2\0F67F\0\0\0\0 @06FFC99A ;
8094: L D6\0 303
8094: ... (6 Replies)
Discussion started by: ghostdog74
6 Replies
9. UNIX for Advanced & Expert Users
hi,
working on Solaris 10. need your help on ping behaviour that I encountered.
I ping from source to destination
-bash-3.2# ping -s -t 128 10.10.10.200
PING 10.10.10.200: 56 data bytes <===== stops here for 2 minutues before getting reply back
64 bytes from 10.10.10.200:... (9 Replies)
Discussion started by: ghostdog74
9 Replies
PREAD(2) Linux Programmer's Manual PREAD(2)
NAME
pread, pwrite - read from or write to a file descriptor at a given offset
SYNOPSIS
#include <unistd.h>
ssize_t pread(int fd, void *buf, size_t count, off_t offset);
ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
pread(), pwrite():
_XOPEN_SOURCE >= 500
|| /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
DESCRIPTION
pread() reads up to count bytes from file descriptor fd at offset offset (from the start of the file) into the buffer starting at buf. The
file offset is not changed.
pwrite() writes up to count bytes from the buffer starting at buf to the file descriptor fd at offset offset. The file offset is not
changed.
The file referenced by fd must be capable of seeking.
RETURN VALUE
On success, the number of bytes read or written is returned (zero indicates that nothing was written, in the case of pwrite(), or end of
file, in the case of pread()), or -1 on error, in which case errno is set to indicate the error.
ERRORS
pread() can fail and set errno to any error specified for read(2) or lseek(2). pwrite() can fail and set errno to any error specified for
write(2) or lseek(2).
VERSIONS
The pread() and pwrite() system calls were added to Linux in version 2.1.60; the entries in the i386 system call table were added in
2.1.69. C library support (including emulation using lseek(2) on older kernels without the system calls) was added in glibc 2.1.
CONFORMING TO
POSIX.1-2001.
NOTES
The pread() and pwrite() system calls are especially useful in multithreaded applications. They allow multiple threads to perform I/O on
the same file descriptor without being affected by changes to the file offset by other threads.
On Linux, the underlying system calls were renamed in kernel 2.6: pread() became pread64(), and pwrite() became pwrite64(). The system
call numbers remained the same. The glibc pread() and pwrite() wrapper functions transparently deal with the change.
On some 32-bit architectures, the calling signature for these system calls differ, for the reasons described in syscall(2).
BUGS
POSIX requires that opening a file with the O_APPEND flag should have no affect on the location at which pwrite() writes data. However, on
Linux, if a file is opened with O_APPEND, pwrite() appends data to the end of the file, regardless of the value of offset.
SEE ALSO
lseek(2), read(2), readv(2), write(2)
COLOPHON
This page is part of release 3.53 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 2013-06-21 PREAD(2)