Google Groups Home
Help | Sign in
comp . unix . programmer
This is a Usenet group - learn more
Find or start a Google Group about programmer.
Active older topics
Related Groups
All issues about multithreaded programming.
Medium activity, Usenet
Writing Linux applications, porting to Linux.
Low activity, Usenet
Linux kernels, device drivers, modules.
Low activity, Usenet
Discussions
View:  Topic list, Topic summary Topics 1 - 10 of 57766  Older »
Description: Q&A for people programming under Unix.
 

daemon openlog() question... 
  How can openlog() in a daemon write to some file if fd 0, 1, and 2 get redirected to /dev/null and ther rest the fds are closed.
By K-mart Cashier  - 02:37 - 7 new of 7 messages    

permission denied on bind when restart with execl 
  Then in my application when alert() happen a signal handler start. The signal handler should restart application, i do it with execl() function: void onTimeoutHandler() { // argv1 & argv2 are two global var that contain argv[1] e argv[2] execl("application", argv1, argv2); ...The apps really restart but the problem is that it stop itself on bind... more »
By Mariano  - 27 Aug - 6 new of 6 messages    

flex & bison: parse command line arguments? 
  Is it possible to parse command line arguments with the help of flex and bison? If so, how is it done? I suspect that it may be simply a matter of tweaking flex into processing arrays of null-terminated strings instead of stdin but I can't find a single reference. So, can anyone help? Thanks in advance,... more »
By Rui Maciel  - 26 Aug - 5 new of 5 messages    

anish add 
  [link]
By anish  - 26 Aug - 1 new of 1 message    

Why does redirection cause the program to terminate in the following case 
  Given the following ...int main(void) { char name[] = "enter name:"; char line[BUFSIZ]; ssize_t n; int fd; if((fd = open("/dev/tty", O_RDWR)) < 0) { fprintf(stderr, "open error\n"); exit(1); } if ((write(1, name, sizeof(name)-1)) != sizeof(name)-1) { fprintf(stderr, "write error \n");... more »
By K-mart Cashier  - 26 Aug - 4 new of 4 messages    

list all file lock in a file 
  Hi. I read the info manual of glibc for the advisory record lock using fcntl(2) function on my Linux system. It says that if the specific part of the file has more than one lock, fcntl(fd, F_GETLK, &lock) will only return information about one of them. After simple experiment, I found that fcntl(, F_GETLK, ) returns the... more »
By cinsk  - 26 Aug - 3 new of 3 messages    

How to fast close socket? 
  Hi, I noticed that after my program exits, there still an entry when I run 'netstat -np', the socket is a TCP socket bind() into a given port, after the exit, seems the state of the connection show TERM-WAIT(or something else) for a few seconds. This bothers me because I want to restart the program very quickly,... more »
By Bin Chen  - 26 Aug - 23 new of 23 messages    

output Nth line of matching string using grep 
  hi, i need to grep in such a way that, i need to print a third line (or Nth line) after the matching string. For example in the above string matching string is ABC and i need to print "This Line". for the following Text my grep output should be ABC dsfsf safdaf This Line ABC dsfsf safdaf One more Line... more »
By sinbad  - 26 Aug - 3 new of 3 messages    

getnameinfo() buffer overflow! 
  ...Hi, Below program can show that the getnameinfo() will grab one more byte than given, I am running that program in Linux. I give the getnameinfo() that the host name buffer length of 7, but it write a '\0' to the eight-th character of the buffer. Anything wrong? main() { struct sockaddr_in sa; /* input */... more »
By Bin Chen  - 25 Aug - 7 new of 7 messages    

minimum # of open file limit? 
  Hi. As long as I understood, when main() is started, thet C start-up code opens three files (stdin, stdout, and stderr). To verify this, consider this small program (a.out): int main(void) { return 0; ...When I limit the maximum # of open file to 3 using ulimit, the program failed to run: $ ulimit -n 3... more »
By cinsk  - 25 Aug - 2 new of 2 messages    

1 - 10 of 57766   « Newer | Older »

XML      
Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google