Search Results

Search: Posts Made By: gokult
Forum: Programming 12-11-2010
1,597
Posted By DGPickett
I never call write() but I error check right...
I never call write() but I error check right there, check amount written, and loop if EINTR, EAGAIN if O_NONBLOCK, too, all part of the joys of raw I/O:
char *write_point ;
int char_to_write ;
int...
Forum: Programming 12-10-2010
1,597
Posted By Corona688
#include<stdio.h> #include<sys/types.h> ...
#include<stdio.h>
#include<sys/types.h>
#include<sys/mman.h>
#include<stdlib.h>
#include<fcntl.h>
#include<sys/stat.h>
#include<unistd.h>
#include<signal.h>
#include<string.h>

main(int...
Forum: Programming 12-09-2010
1,222
Posted By kermit
Well your first problem is that 'If' is not a...
Well your first problem is that 'If' is not a keyword in C, whereas 'if' is. As an aside, you ought not put your call to strlen() inside the loop like you have. Change your code from:

for(i=0;i<...
3
4,708
Posted By Corona688
Now that you've mapped it, it's just memory. If...
Now that you've mapped it, it's just memory. If you know how to use an array, this isn't much different.

void *mem=mmap(...);
char *textdata=(char *)mem;

printf("char 0 is %c\n",...
3
4,708
Posted By Corona688
man mmap is very a good start. Read up on the...
man mmap is very a good start. Read up on the options I'm feeding mmap in the snippet below.

#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/types.h>
#include...
3,063
Posted By Scott
Do not post classroom or homework problems in the...
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum (https://www.unix.com/homework-coursework-questions/) under special...
3,063
Posted By Corona688
Is this homework?
Is this homework?
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 03:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy