Re: Problem of this code?

1998-04-23 Thread Glynn Clements
is zero it means `all of remaining bytes in the file'). Why function fcntl so sensitive? It isn't. You are not using it correctly. -- Glynn Clements [EMAIL PROTECTED]

Re: combo box

1998-04-23 Thread Glynn Clements
come with any documentation? I really appreciate any feedback (sample source code/ pointers to internet sites ...) There isn't any online documentation for Motif 2.*. SCO have the Motif 1.2 manual pages online, but ComboBox is specific to Motif 2.*. -- Glynn Clements [EMAIL PROTECTED]

Re: exit system call

1998-04-23 Thread Glynn Clements
to stop and the ping program will continue to ping other machine. That doesn't make sense. -- Glynn Clements [EMAIL PROTECTED]

Re: gdb..

1998-04-24 Thread Glynn Clements
/lib/libfoo.a) to the gcc command, rather than using -lfoo. so debug libraries are usually linked statically to the code, right? Yep. -- Glynn Clements [EMAIL PROTECTED]

Re: host - ip program

1998-08-08 Thread Glynn Clements
. -- Glynn Clements [EMAIL PROTECTED]

RE: Malloc()

1998-08-12 Thread Glynn Clements
s? or do i have to use X) splitvt does this. Alternatively, you could try using a real text editor :) -- Glynn Clements [EMAIL PROTECTED]

Re: curses

1998-08-18 Thread Glynn Clements
tk() calls, and then monitor the syslog output from user space. -- Glynn Clements [EMAIL PROTECTED]

Re: gdb question

1998-08-24 Thread Glynn Clements
tools are the Info documents. gcc and gdb both have sizeable Info files, as do make, libc, and binutils. In terms of tying everything together into a single environment, XEmacs does a pretty good job. If you aren't satisfied with XEmacs' gdb interface, there's DDD. -- Glynn Clements [EMAIL

Re: Images in C

1998-08-26 Thread Glynn Clements
Augusto Cesar wrote: I don't know where you can find xpm format doc's, but it is a start. The Xpm distribution comes with documentation in the xpm.PS file, although I wouldn't put it past distribution vendors to ship Xpm without the docs. -- Glynn Clements [EMAIL PROTECTED]

Re: Float to binary string (or Hex string I suppose)

1998-08-26 Thread Glynn Clements
eed to use memcpy() for this; you could replace memcpy ( (void*)i_f, (void*)f,4); memcpy ( (void*)i_d1, (void*)d,4); memcpy ( (void*)i_d2, (void*)((d)+4),4); with i_f = *(int *)f; i_d1 = *(int *)d; i_d2 = *((int *)d + 1); -- Glynn Clements [EMAIL PROTECTED]

Re: Printer Filters

1998-08-26 Thread Glynn Clements
sort of printer you're talking to. The command line arguments are specified in the printcap(5) manpage. -- Glynn Clements [EMAIL PROTECTED]

Re: ppp

1998-08-27 Thread Glynn Clements
. Advanced Programming in the Unix Envionment W Richard Stevens Addison-Wesley -- Glynn Clements [EMAIL PROTECTED]

Re: nm zImage

1998-08-28 Thread Glynn Clements
Christoph Bugel wrote: is there a way to do 'nm' on my kernel zImage, or should I compile the kernel to another format? You need to run `nm' on the uncompressed kernel (vmlinux). -- Glynn Clements [EMAIL PROTECTED]

Re: missing library

1998-08-28 Thread Glynn Clements
doesn't use libsocket; the socket functions are built into libc. Likewise for libnsl. Just remove the -lsocket and -lnsl options from the link command. -- Glynn Clements [EMAIL PROTECTED]

Re: Binary

1998-08-29 Thread Glynn Clements
numbers in binary. -- Glynn Clements [EMAIL PROTECTED]

Re: SPAM

1998-09-01 Thread Glynn Clements
Richard Ivanowich wrote: Is it just me or is spam really bad on this list. It's just you. Over the past few months, the number of messages discussing spam sent to this list exceeds the number of actual spams. -- Glynn Clements [EMAIL PROTECTED]

Re: memcpy_tofs ?

1998-09-03 Thread Glynn Clements
command, I didn't find any information of it. man memcpy_tofs no manual entry for memcpy_tofs Internal kernel functions don't have manpages. -- Glynn Clements [EMAIL PROTECTED]

Re: Still confuse with return

1998-09-04 Thread Glynn Clements
an error (unless your compiler is seriously broken). The return value will be silently converted to an int. -- Glynn Clements [EMAIL PROTECTED]

Re: Still confuse with return

1998-09-05 Thread Glynn Clements
are perfectly valid. -- Glynn Clements [EMAIL PROTECTED]

Re: Global variables

1998-09-05 Thread Glynn Clements
computer on?' -- Glynn Clements [EMAIL PROTECTED]

Re: A CVS question

1998-09-06 Thread Glynn Clements
in my response to your original posting of this question. -- Glynn Clements [EMAIL PROTECTED]

Re: loading info into structures

1998-09-08 Thread Glynn Clements
not necessarily be a problem. No doubt there are also other possibilities. -- Glynn Clements [EMAIL PROTECTED]

RE: loading info into structures

1998-09-09 Thread Glynn Clements
/flex in combination with bison/yacc, doing the high level parsing with the latter. For parsing more complex formats, yacc is (IMHO) the way to go. However, in this particular case, the input format has a flat (i.e. non-recursive) syntax, so I think that using yacc would be overkill. -- Glynn

Re: function parameters

1998-09-09 Thread Glynn Clements
i++) printf("%s\n", va_arg(va, char *)); va_end(va); } int main(void) { contrived(3, "hello", "there", "world"); return 0; } -- Glynn Clements [EMAIL PROTECTED]

Re: Compiling code for linux

1998-09-09 Thread Glynn Clements
to nothing. For more details, see the `make' info file (`C-h C-i make'). -- Glynn Clements [EMAIL PROTECTED]

Re: Reading file in a structure

1998-09-12 Thread Glynn Clements
. How do i do this??? It depends entirely upon the format of the file. -- Glynn Clements [EMAIL PROTECTED]

Re: Reading file in a structure

1998-09-12 Thread Glynn Clements
yntax error: %s", buff); continue; } /* do something with `name' and `number' */ } A custom scanner built using lex will be more efficient, but it's unlikely to be worth the effort in this case. -- Glynn Clements [EMAIL PROTECTED]

Re: Getting Strings with spaces

1998-09-12 Thread Glynn Clements
is. This introduces the potential for buffer overruns. The GNU tools generate the warning: the `gets' function is dangerous and should not be used. if you try to use it. Use fgets() instead. -- Glynn Clements [EMAIL PROTECTED]

Re: reading a block

1998-09-13 Thread Glynn Clements
from the filesystem (/dev/hda5) at all. how does it check the partition, then? is this maybe a technicality of strace? same reason that it doesn't show the exec() after the fork()? You need to use the -f switch if you want to trace child processes as well as the parent. -- Glynn Clements [EMAIL

Re: Demo programming under Linux

1998-09-14 Thread Glynn Clements
-- Glynn Clements [EMAIL PROTECTED]

Re: prompt when 25 lines..

1998-09-17 Thread Glynn Clements
t's due to something in the `//other functions' section. -- Glynn Clements [EMAIL PROTECTED]

Re: FD_ISSET -- select -- bug?? need help.

1998-09-22 Thread Glynn Clements
Henrik Nordstrom wrote: Glynn Clements wrote: I don't think that you should use select() on descriptors which are non-blocking. You would normally either use select() or non-blocking I/O, but not both. I have to disagree here. Using select is REQUIRED when doing non-blocking I/O

Re: How to use getopt() ?

1998-09-22 Thread Glynn Clements
utilities. They nearly all use getopt() for parsing the command line. Also, the libc Info file has a couple of examples of using getopt(). -- Glynn Clements [EMAIL PROTECTED]

Re: Graphics and C with linux

1998-09-22 Thread Glynn Clements
are unfamiliar with X programming, get a decent book. -- Glynn Clements [EMAIL PROTECTED]

Re: Need help writing a terminal emulator

1998-09-22 Thread Glynn Clements
`19200' is the line speed, `ttyS0' is the serial port, and `dumb' is the terminal type (used to initialise $TERM). -- Glynn Clements [EMAIL PROTECTED]

Re: daemons

1998-09-22 Thread Glynn Clements
n the line the daemon does something else? This is difficult to do in a portable manner. You could try using the TIOCMGET ioctl() to monitor the status lines; that may be adequate. Alternatively, you could try polling for a lock file. -- Glynn Clements [EMAIL PROTECTED]

RE: Waiting for 125msecs.

1998-09-29 Thread Glynn Clements
minate any sooner. #include unistd.h #include signal.h int main(void) { signal(SIGALRM, SIG_IGN); usleep(10 * 100); return 0; } -- Glynn Clements [EMAIL PROTECTED]

Re: stat

1998-09-30 Thread Glynn Clements
(buf.st_rdev)) /* st_rdev seemed the most sensible */ Why? I guess you were reading the `device type (if inode device)' comment. st_rdev contains the major/minor numbers for devices; it doesn't apply to any other inode type. It should be if (S_ISREG(buf.st_mode)) -- Glynn Clements [EMAIL PROTECTED]

Re: segmentation fault

1998-10-02 Thread Glynn Clements
an official way, but the address appears to be available in the eax register, and also at ebp+56. I think that its presence at ebp+56 may be deliberate (from setup_frame(), in arch/i386/kernel/signal.c), while its presence in eax may be accidental. -- Glynn Clements [EMAIL PROTECTED] #include signal.h

Re: forking in signal handler?

1998-10-02 Thread Glynn Clements
with different stack, so chind process will get copy of global data and copy of signal stack??? The child will need any signal context, as it will still be in a signal handler after the fork. -- Glynn Clements [EMAIL PROTECTED]

Re: pipe blocking semantics

1998-10-09 Thread Glynn Clements
o the pipe. -- Glynn Clements [EMAIL PROTECTED]

Re: A problem with ncurses

1998-10-10 Thread Glynn Clements
(which happens alot and perfectly too) win[0] fails to respond. I have no idea how this could happen, can anyone help? Can you provide a complete (compilable) example? -- Glynn Clements [EMAIL PROTECTED]

Re: mouse won't work

1998-10-10 Thread Glynn Clements
Shekhar Shenvikerkar wrote: I used the getmouse() function from the ncurses library. But the function is not working. Have you used the mousemask() function to enable mouse events? They aren't enabled by default. -- Glynn Clements [EMAIL PROTECTED]

Re: delay execution in the kernel level code.

1998-10-11 Thread Glynn Clements
or switch to using a real-time OS. -- Glynn Clements [EMAIL PROTECTED]

Re: delay execution in the kernel level code.

1998-10-12 Thread Glynn Clements
-space processes of CPU time (or am I overlooking something?) -- Glynn Clements [EMAIL PROTECTED]

Re: a question

1998-10-18 Thread Glynn Clements
but.. in the while(...) donĀ“t specifies any function. Wich function expects while(...) to return 1 to exit loop? The above loop will never terminate. -- Glynn Clements [EMAIL PROTECTED]

Re: style

1998-10-19 Thread Glynn Clements
recommend a good C reference book (reference, not tutorial...) The C Programming Language (2nd Edition) Brian W Kernighan Dennis M Ritchie Prentice Hall Note that this doesn't cover style. You can't really have a `reference' book for style. -- Glynn Clements [EMAIL

Re: Mail

1998-10-26 Thread Glynn Clements
program (sendmail, procmail etc) tries to fiddle with the locked mail spool, do they just hang around waiting? Yes, although procmail will apparently override the lockfile after a certain amount of time. However, fcntl() locks won't be (can't be) overriden. -- Glynn Clements [EMAIL PROTECTED]

Re: TSRs

1998-10-26 Thread Glynn Clements
Richard Ivanowich wrote: Does anyone know how to make a TSR program. Linux doesn't support the DOS-specific concept of TSR programs. What sort of functionality are you trying to obtain? -- Glynn Clements [EMAIL PROTECTED]

Re: stop this spam

1998-10-27 Thread Glynn Clements
in order to harvest the email addresses of people who post to it. The only way to prevent that is to never post to mailing lists using your correct email address. -- Glynn Clements [EMAIL PROTECTED]

Re: TSRs

1998-10-28 Thread Glynn Clements
that there are plans to implement this feature. -- Glynn Clements [EMAIL PROTECTED]

Re: Passing arguments to functions

1998-10-28 Thread Glynn Clements
) { *tmp += 5; } Yep. And if you compare the code which is generated, it will be identical to using a reference. -- Glynn Clements [EMAIL PROTECTED]

Re: changing time on a symlink

1998-10-29 Thread Glynn Clements
files correcty, but when I go back to change dates on the restored data, I cannot do it for symbolic links. No, you can't. -- Glynn Clements [EMAIL PROTECTED]

Re: Catching Signals /sigaction() signal()

1998-10-30 Thread Glynn Clements
f SA_ONESHOT | SA_NODEFER. The BSD version is equivalent to using sigaction() with an sa_flags field of SA_RESTART. In any event I found that by by using the flag: newaction.sa_flags = SA_ONESHOT; Which is what you should be doing. in the above program causes the default behavior to

Re: makefile for two programs

1998-11-02 Thread Glynn Clements
server_bar.o prog2: client_foo.o client_bar.o -- Glynn Clements [EMAIL PROTECTED]

Re: lack of Header and Function HELP

1998-11-05 Thread Glynn Clements
() or even getch()? curses provides a getch() function. However, if the program was written for DOS, you may need to make many other changes to get it to run on a different OS. If you are just starting to learn C, you would be better off with a book that isn't DOS-specific. -- Glynn Clements

Re: Newbie Header Q's

1998-11-06 Thread Glynn Clements
andalone Info reader is really poor. -- Glynn Clements [EMAIL PROTECTED]

Re: Newbie Header Q's

1998-11-07 Thread Glynn Clements
. -- Glynn Clements [EMAIL PROTECTED]

Re: Newbie Header Q's

1998-11-07 Thread Glynn Clements
is bloated instead... I actually use some of XEmacs' extra features (e.g. inline images in MIME-email and HTML). -- Glynn Clements [EMAIL PROTECTED]

Re: last question :)

1998-11-07 Thread Glynn Clements
may not allow the process to access the file). You can determine whether the process can access the file using access(). Also, you need to have execute permission on all of the parent directories in order to be able to discover anything about a file (including whether it exists). -- Glynn

Re: FILE * problems...

1998-11-07 Thread Glynn Clements
); /* pass a pointer to `n' */ printf("n = %d\n", n); } -- Glynn Clements [EMAIL PROTECTED]

Re: newbie graphics idea

1998-05-08 Thread Glynn Clements
yone knows if these are documented online anywhere, could they let me know.) -- Glynn Clements [EMAIL PROTECTED]

Re: newbie graphics idea

1998-05-08 Thread Glynn Clements
t clearing it, so you can create a new page by drawing on top of the previous one. Also, ghostscript's X11 driver shows the page as it's being constructed; you don't need a showpage or copypage to get it displayed. -- Glynn Clements [EMAIL PROTECTED]

Re: How does one manage files with separators?

1998-05-11 Thread Glynn Clements
d a sample on how to read the file, and retrieve both Field and Value You can read a line from a stream (i.e. a `FILE *') with fgets(), and you can get a pointer to the first occurrence of a particular character using strchr(). -- Glynn Clements [EMAIL PROTECTED]

Re: Check if file exists

1998-05-14 Thread Glynn Clements
need to open() the file and then use fstat() on the descriptor. -- Glynn Clements [EMAIL PROTECTED]

Re: libcom_err.so

1998-05-20 Thread Glynn Clements
usage/docs/urls for this library? It's part of the ext2fs tools. I don't know if there is any documentation for it (other than the source code). -- Glynn Clements [EMAIL PROTECTED]

Re: detecting a mouse click

1998-05-20 Thread Glynn Clements
to a XmDrawingAreaCallbackStruct: typedef struct { int reason; XEvent * event; Window window; } XmDrawingAreaCallbackStruct; You can get the mouse coordinates from the `event' field. -- Glynn Clements [EMAIL PROTECTED]

Re: gdbm passwords

1998-05-20 Thread Glynn Clements
abilities aren't all that good. -- Glynn Clements [EMAIL PROTECTED]

Re: Hey, could someone critique a little app I did?

1998-05-25 Thread Glynn Clements
Pete Ryland wrote: On Sat, 23 May 1998, Glynn Clements wrote: Personally, I avoid using `!strcmp(...)'; I find `strcmp(...) == 0' to be more intuitive. __Personally__ I like the opposite ;-). I always use ! when I can. It' s faster and nicer. Don't be fooled! Just because

Re: Hey, could someone critique a li

1998-05-25 Thread Glynn Clements
s2) { return strcmp(s1, s2) == 0; } -- Glynn Clements [EMAIL PROTECTED]

Re: Hey, could someone critique a li

1998-05-25 Thread Glynn Clements
t), and `equal' (which tells you whether the objects are equal). Likewise with Java; you have both `==' (reference equality) and `equals' (value equality). The only languages where there is no difference are pure functional languages (e.g. Haskell, Hope), where there is no notion of mutable state. -- Glynn Clements [EMAIL PROTECTED]

Re: Hey, could someone critique a li

1998-05-25 Thread Glynn Clements
to-an-int; ptr_char char-pointer; Yes, but if you wanted it to work for all types, c-2.h would be infinitely long. I would agree that C's type syntax is probably not one of its better features, although it probably seemed like a good idea at the time. The syntax of function types is particul

Re: detecting a mouse click

1998-05-26 Thread Glynn Clements
for which the callback is invoked? Under what circumstances do you want the function to be called? Widget callbacks are called whenever something interesting happens to the widget, so it's inevitable that they associated with a specific widget. -- Glynn Clements [EMAIL PROTECTED]

Re: Daemon Programming

1998-05-26 Thread Glynn Clements
packages is the Linux Archive Search: http://torgo.ml.org/las -- Glynn Clements [EMAIL PROTECTED]

RE: RE: setuid root ?

1998-05-26 Thread Glynn Clements
now). I havent tried this yet, though. The standard way to permanently drop all root privileges on Linux is to call `setuid(getuid())'. -- Glynn Clements [EMAIL PROTECTED]

Re: XDrawString

1998-05-26 Thread Glynn Clements
event. -- Glynn Clements [EMAIL PROTECTED]

Re: setuid root ?

1998-05-26 Thread Glynn Clements
every user on the system to obtain full root privileges; i.e. they will be able to execute any command whatsoever as root. -- Glynn Clements [EMAIL PROTECTED]

Re: Hey, could someone critique a little app I did?

1998-05-26 Thread Glynn Clements
make your code not portable. Using ! to check for a NULL pointer is entirely portable. -- Glynn Clements [EMAIL PROTECTED]

Re: Daemon Programming

1998-05-26 Thread Glynn Clements
are set up to be the connected socket. That means you should probably skip steps 6, 7 and 8. If the program is being started from inetd, you shouldn't need to do any of this. -- Glynn Clements [EMAIL PROTECTED]

Re: what if I redefine NULL to (void *) 0xffffffff?

1998-05-27 Thread Glynn Clements
. -- Glynn Clements [EMAIL PROTECTED]

Re: Hey, could someone critique a little app I did?

1998-05-28 Thread Glynn Clements
of testing for a null pointer?? Using `!p' is sufficient. If you use `p != NULL', you need to include stdio.h to ensure that NULL is defined, which is kind of overkill if you're not using anything else from stdio.h. -- Glynn Clements [EMAIL PROTECTED]

Re: Socket Status

1998-05-28 Thread Glynn Clements
ts in the FIN_WAIT_2 state. The RFC-specified behaviour would seem to suffer from the problem that if the remote end crashes, the local socket would be stuck in the FIN_WAIT_2 state forever. -- Glynn Clements [EMAIL PROTECTED]

Re: what if I redefine NULL to (void *) 0xffffffff?

1998-05-28 Thread Glynn Clements
won't. Most systems use an all-zeroes bit pattern for NULL. I personally don't know of a system which doesn't. -- Glynn Clements [EMAIL PROTECTED]

Re: Char device name block device

1998-11-08 Thread Glynn Clements
Salil Kumar wrote: I have the block device name for disk, I want to find out associated raw device name. What do you mean by the `raw device'? -- Glynn Clements [EMAIL PROTECTED]

Re: checking if a file is already opened file locks

1998-11-08 Thread Glynn Clements
code work everywhere : char *p; p = malloc( 10); p += 4; free( p); No. The argument to free() should be a pointer which was previously returned from malloc(), calloc() or realloc(). The behaviour when passing any other value is undefined. -- Glynn Clements [EMAIL PROTECTED]

Re: Checksums

1998-11-08 Thread Glynn Clements
are, though. -- Glynn Clements [EMAIL PROTECTED]

Re: Nothing to do with C programming [Was: Re: Newbie Header Q's]

1998-11-08 Thread Glynn Clements
re details. -- Glynn Clements [EMAIL PROTECTED]

Re: Newbie Header Q's

1998-11-08 Thread Glynn Clements
James wrote: - int main(int argc, char **argv, char **envp) this one's new to me... don't tell me, **envp points to a string of all the environment variables.. Yep. It should be identical to the global variable `environ'. -- Glynn Clements [EMAIL PROTECTED]

Re: pclose()

1998-11-09 Thread Glynn Clements
. -- Glynn Clements [EMAIL PROTECTED]

Re: Char device name block device

1998-11-09 Thread Glynn Clements
OS is this on? It doesn't look like anything that I've seen on Linux. -- Glynn Clements [EMAIL PROTECTED]

Re: Newbie Header Q's

1998-11-09 Thread Glynn Clements
consoles and dumb terminals. I often use ed for editing files over a slow telnet link. -- Glynn Clements [EMAIL PROTECTED]

Re: setenv() does nothing

1998-11-11 Thread Glynn Clements
`dircolors' uses. -- Glynn Clements [EMAIL PROTECTED]

Re: Why wont this code work well?

1998-11-11 Thread Glynn Clements
perror("write"); exit(1); } -- Glynn Clements [EMAIL PROTECTED]

Re: Pthreads

1998-11-12 Thread Glynn Clements
of system headers. I don't know about SunOS. On Linux, libpthread redefines various libc functions. Linking against libpthread will cause problems if the executable or another library wasn't compiled for a multithreaded environment. -- Glynn Clements [EMAIL PROTECTED]

Re: Problems with qsort

1998-11-12 Thread Glynn Clements
in the array? If not, the undefined elements (which will be all zeroes) will come first. E.g. if you have 10 defined elements, after the qsort, the 14990 undefined elements will come first, and the 10 defined elements will be at the end of the array. -- Glynn Clements [EMAIL PROTECTED]

Re: indenting question

1998-11-12 Thread Glynn Clements
? 2/4/8? Tab stops should always be 8 characters. The indent level is entirely a matter of personal preference. IOW, if you want to indent by something other than 8 spaces, use spaces. Don't create source files which require the tab width to be set to something other than 8. -- Glynn Clements

Re: dynamic list

1998-11-12 Thread Glynn Clements
dereference it twice, e.g. with (*PasswordList)[i] or PasswordList[0][i] And sizeof(*PasswordList) would be equal to 20 * sizeof(pwlistentry) so PasswordList++ would increment PasswordList by 20 * sizeof(pwlistentry) bytes. -- Glynn Clements

Re: Passwords

1998-11-13 Thread Glynn Clements
mmand line; however, this is risky, as it will show up in the output of `ps'. You can either use expect to script an interactive session, or you can get the util-linux source and modify passwd to read the password from stdin (it currently reads it directly from the controlling tty). -- Glynn Cleme

Re: linked list question

1998-11-13 Thread Glynn Clements
= list; if (list) list-prev = new_item; return new_item; } -- Glynn Clements [EMAIL PROTECTED]

Re: free memory?

1998-11-13 Thread Glynn Clements
that you will need to dig around in the process' /proc/pid directory. Note that malloc() can allocate non-contiguous chunks of memory using anonymous mmap(), as well as by using brk(). -- Glynn Clements [EMAIL PROTECTED]

  1   2   3   4   >