Search Results

Search: Posts Made By: Driver
Forum: Programming 01-18-2011
7,029
Posted By Driver
It's dead, Jim! :cool: For some reason...
It's dead, Jim!

:cool:

For some reason that reminds me of this:
Everybody loves Eric Raymond So I married a Kernel Programmer...
Forum: Programming 01-18-2011
7,029
Posted By Driver
I guess what prompted all this was the following...
I guess what prompted all this was the following remark (which I might even have overlooked since I didn't read the entire thread in detail):



Certainly I agree that the properties of scope,...
Forum: Programming 01-18-2011
7,029
Posted By Driver
I'm not sure how to respond to this because I...
I'm not sure how to respond to this because I don't see the point you're making, or how it's relevant to the topic at hand.

For what it's worth, it is my opinion that address space layout is not a...
Forum: Programming 01-18-2011
7,029
Posted By Driver
I don't think the way you are using this term is...
I don't think the way you are using this term is common. Most of the time when people refer to "the heap" of a program, they mean the area(s) from which dynamic memory is allocated...
Forum: Programming 01-15-2011
7,029
Posted By Driver
The reason pointer arithmetic is scaled for the...
The reason pointer arithmetic is scaled for the base type is simply to support array operations.

Given

int x[2];

... we access the second element of the array by writing x[1] or equivalently...
Forum: Programming 12-19-2010
10,351
Posted By Driver
Right, it just shows how to read the data. You'd...
Right, it just shows how to read the data. You'd have to store and evaluate it yourself. You will probably also want to handle backspace (\b) and print "\b \b" to erase that last character from the...
Forum: Programming 12-19-2010
10,351
Posted By Driver
The code is missing one or more includes. If...
The code is missing one or more includes.

If you're on a newish system, try adding "#include <sys/select.h>". Otherwise, try "#include <sys/types.h>" and "#include <unistd.h>".

Jim's code looks...
Forum: Programming 12-17-2010
10,351
Posted By Driver
The proper behavior is to wait for one character....
The proper behavior is to wait for one character. I have used this construct (~ICANON|ECHO, VMIN=1, VTIME=0) on tons of systems (Linux, *BSD, OSX, AIX, Tru64 and Digital UNIX, IRIX, HP-UX, UnixWare)...
Forum: Programming 12-17-2010
10,351
Posted By Driver
So you're saying 1 is the correct setting, right?...
So you're saying 1 is the correct setting, right? :) We do want to block, reading one character at the time, and that's just normal behavior for noncanonical terminals unless you're using O_NONBLOCK....
Forum: Programming 12-16-2010
10,351
Posted By Driver
I haven't tried your code, but this line bothers...
I haven't tried your code, but this line bothers me:

term.c_cc[VMIN]=0;

Isn't that supposed to be 1 for what you're looking to do? Maybe your OS handles the 0 case differently from those...
Forum: Programming 12-06-2010
5,785
Posted By Driver
Look up "spurious wakeups". The function...
Look up "spurious wakeups".

The function could return for some reason other than the thread signaling the condition variable. In practice some implementations have an unrestartable...
Forum: Programming 04-10-2010
3,799
Posted By Driver
I hope you are aware that file locking doesn't...
I hope you are aware that file locking doesn't prevent any process from doing anything - apart from setting a conflicting lock of course - if you didn't explicitly request mandatory locking.

The...
Forum: Programming 04-08-2010
14,353
Posted By Driver
I think some versions of their implementation...
I think some versions of their implementation also drop packets during system memory shortage even after having reported availability with select(). For TCP sockets, I believe there may be a race...
Forum: Programming 04-07-2010
14,353
Posted By Driver
Just from looking at that single post and its...
Just from looking at that single post and its title, I believe you misunderstood the discussion/conclusion in that thread.

When the kernel people speak of "breaking" select(), they mean altering...
Forum: Programming 09-22-2006
10,558
Posted By Driver
For great justice!!
You can also fork() and read the result of getppid() from the child or raise() a signal with SA_SIGINFO set and examine si_pid or use msgsnd() and look at msg_lspid for the message queue or send PID...
Forum: Programming 05-21-2006
8,876
Posted By Driver
So you're on Solaris. Please forget about...
So you're on Solaris. Please forget about /usr/ucb/cc, it's a BSD compiler and doesn't have "high tech" ANSI features like, ... the const keyword. Try /cc/SUNWspro/bin/cc. If you're on Solaris 10,...
Forum: Programming 08-11-2005
4,059
Posted By Driver
Here's what I use to catch accidental variable...
Here's what I use to catch accidental variable modifications from other functions:

#include <sys/types.h>
#include <sys/mman.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
...
Forum: Programming 10-15-2004
3,771
Posted By Driver
Read up on ...
Read up on

opendir()/readdir()/closedir()/fnmatch()

or

glob()

ftw() (with fnmatch()) may be of interest as well if you do not care about portability with BSD systems - everyone but they...
1,864
Posted By Driver
2,460
Posted By Driver
Forum: HP-UX 08-13-2004
8,521
Posted By Driver
Forum: Programming 07-05-2004
1,496
Posted By Driver
I'm sorry, we won't do your homework. See point 6...
I'm sorry, we won't do your homework. See point 6 of the rules:

https://www.unix.com/showthread.php?threadid=2971

Ask your teacher if you're stuck. (and buy ``Advanced Programming in the UNIX...
17,502
Posted By Driver
#!/bin/sh if `test -d /path/to/directory`; then...
#!/bin/sh
if `test -d /path/to/directory`; then
# does exist
else
# does not exist
fi
Forum: Programming 06-08-2004
9,158
Posted By Driver
The artificial restriction tells us that this is...
The artificial restriction tells us that this is a homework assignment. If you read the unix.com rules:

https://www.unix.com/showthread.php?s=&threadid=2971

... you'll see that homework...
4,596
Posted By Driver
Showing results 1 to 25 of 45

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