09-16-2009
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I got the freebsd kernel source from the first install CD(in directory:\7.0-RELEASE\src\),isn't right? if so,how can i read it? Is there any tools? (4 Replies)
Discussion started by: zhouq3132
4 Replies
2. Shell Programming and Scripting
I need to find all the files that have group Read or Write permission or files that have user write permission.
This is what I have so far:
find . -exec ls -l {} \; | awk '/-...rw..w./ {print $1 " " $3 " " $4 " " $9}'
It shows me all files where group read = true, group write = true... (5 Replies)
Discussion started by: shunter63
5 Replies
3. Programming
Ok, so I'm trying to finalize my understanding of read/write and kernel interaction.
read():
You have a library function that has as it's first parameter (what the open file to read from is), second parameter( a pointer to a buffer (is this the location of a buffer in the user area or the... (7 Replies)
Discussion started by: Krothos
7 Replies
4. IP Networking
Hi,
We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies
5. Solaris
Hi gurus
Could anybody tell me which file is read by kernel to set its default system kernal parameters values in solaris. Here I am not taking about /etc/system file which is used to load kernal modules or to change any default system kernal parameter value
Is it /dev/kmem file or something... (1 Reply)
Discussion started by: girish.batra
1 Replies
6. Shell Programming and Scripting
im in a basic unix class and our professor speaks broken engliash so i can never understand what exactly we are doing in class and i have no prior experience with unix. we were given an assignment to make 2 files. one to Input 10 numbers and print out the biggest number, and one to Write a script... (1 Reply)
Discussion started by: wendyshephard
1 Replies
7. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
make 2 files. one to Input 10 numbers and print out the biggest number, and one to Write a script that can check... (1 Reply)
Discussion started by: wendyshephard
1 Replies
8. Programming
Hi, im trying to lern about raw sockets with my debian and c++. Tried to make a icmp and tcp packet and send it with sendto. Checked on wireshark and recognized that kernel changed my headers. So searched about stopping the kernel change the header and tried it with setsockopt, like said in at this... (4 Replies)
Discussion started by: sandcastle
4 Replies
9. Programming
Hi,
I have started reading about Linux kernel. The books also explains about the source code here and there.
I found a file named head.s in the source which i am not able to understand, it looks like some assembly language.
Can anyone confirm this, so that can start looking for assemble... (3 Replies)
Discussion started by: kumaran_5555
3 Replies
10. Ubuntu
I'm a beginner to the Linux programming and trying my hands on some device driver examples while practising. The below code (a trimmed down version of tiny_tty.c from ldd3 book) loads perfectly using insmod and I'm able to see it in /proc/tty/drivers , /proc/modules and device nodes are getting... (1 Reply)
Discussion started by: diwsdiwa
1 Replies
LEARN ABOUT MOJAVE
dispatch_write
dispatch_read(3) BSD Library Functions Manual dispatch_read(3)
NAME
dispatch_read, dispatch_write -- asynchronously read from and write to file descriptors
SYNOPSIS
#include <dispatch/dispatch.h>
void
dispatch_read(int fd, size_t length, dispatch_queue_t queue, void (^handler)(dispatch_data_t data, int error));
void
dispatch_write(int fd, dispatch_data_t data, dispatch_queue_t queue, void (^handler)(dispatch_data_t data, int error)));
DESCRIPTION
The dispatch_read() and dispatch_write() functions asynchronously read from and write to POSIX file descriptors. They can be thought of as
asynchronous, callback-based versions of the fread() and fwrite() functions provided by the standard C library. They are convenience func-
tions based on the dispatch_io_read(3) and dispatch_io_write(3) functions, intended for simple one-shot read or write requests. Multiple
request on the same file desciptor are better handled with the full underlying dispatch I/O channel functions.
BEHAVIOR
The dispatch_read() function schedules an asynchronous read operation on the file descriptor fd. Once the file descriptor is readable, the
system will read as much data as is currently available, up to the specified length, starting at the current file pointer position. The given
handler block will be submitted to queue when the operation completes or an error occurs. The block will be passed a dispatch data object
with the result of the read operation. If an error occurred while reading from the file descriptor, the error parameter to the block will be
set to the appropriate POSIX error code and data will contain any data that could be read successfully. If the file pointer position is at
end-of-file, emtpy data and zero error will be passed to the handler block.
The dispatch_write() function schedules an asynchronous write operation on the file descriptor fd. The system will attempt to write the
entire contents of the provided data object to fd at the current file pointer position. The given handler block will be submitted to queue
when the operation completes or an error occurs. If the write operation completed successfully, the error parameter to the block will be set
to zero, otherwise it will be set to the appropriate POSIX error code and the data parameter will contain any data that could not be written.
CAVEATS
The data object passed to a handler block is released by the system when the block returns. If data is needed outside of the handler block,
it must concatenate, copy, or retain it.
Once an asynchronous read or write operation has been submitted on a file descriptor fd, the system takes control of that file descriptor
until the handler block is executed. During this time the application must not manipulate fd directly, in particular it is only safe to close
fd from the handler block (or after it has returned).
If multiple asynchronous read or write operations are submitted to the same file descriptor, they will be performed in order, but their han-
dlers will only be submitted once all operations have completed and control over the file descriptor has been relinquished. For details on
this and on the interaction with dispatch I/O channels created from the same file descriptor, see FILEDESCRIPTOR OWNERSHIP in
dispatch_io_create(3).
SEE ALSO
dispatch(3), dispatch_data_create(3), dispatch_io_create(3), dispatch_io_read(3), fread(3)
Darwin December 1, 2010 Darwin