HDTenEightyP/NetNews huggingface dataset:
From: jwilliam@endor.sim.es.com (Jerry Williams x2562)
Subject: cc ld on ix386
Summary: help
Keywords: libraries, linking
Organization: Evans & Sutherland Computer Corporation
Date: Tue, 18 Aug 1992 02:53:15 GMT

I am trying to understand more about cc and ld on an Interactive Unix
sysV rel 3.2.  If I take the hello world program and use:
cc -o hello hello.c this works fine.
If I do something like:
cc -g hello.c I get a hello.o
and when I try:
ld -o hello hello.o    I get a couple of errors saying that it can't find
things like printf and exit.  So I think that I need to link them with
some libraries but I don't know what.  Everything that I have tried doesn't
work.  So I would like to know what cc is doing that ld isn't.
Another thing that I am trying to do is use sockets.  So I would also like
to know what I have to link to a program to get things like:
socket, inet_addr, connect, bzero.
to be defined.

Thanks!  Please send me email as I might miss a post.

Also I hope that this is the right group to post this to.  If not please

help me find the right group thanks again.  Also is there a way to use

nm or something like it to tell which libraries to link with a program?


-- 

Jerry Williams @ Evans & Sutherland  560 Arapeen Drive, SLC, Utah 84108
jwilliam@endor.sim.es.com     or   jwilliam%endor@sim.es.com
..sim.es.com!endor!jwilliam  or   {decwrl, utah-cs}!esunix!jwilliam
Newsgroups: comp.unix.programmer,comp.unix.questions
From: mahmood@lambda.msfc.nasa.gov (Rafique Mahmood)
Subject: TLI vs SOCKET ?? Can TLI replace SOCKET for networking code?
Keywords: TLI vs. SOCKET
Organization: NASA/MSFC
Date: Thu, 13 Aug 1992 19:42:19 GMT

 I did a posting on yesterday about X/Open portability guide. This is
a followup posting on that. I am thinking to use TLI (transport layer
Interface) which uses t_open, t_connect etc. instead of socket.

I am doing research on 'Does POSIX support the X/Open Portability
guide'?

My main concern is VMS POSIX. How can I write the networking code
which will run on all UNIX/ULTRIX/POSIX?

If anyone has any experience/knowledge on this subject, please
let me know via email.


Thanks in advance,

Rafique J. Mahmood
email - mahmood@lambda.msfc.nasa.gov
phone - 205-544-6475

Xref: sparky comp.unix.programmer:4304 comp.lang.c:12343 comp.arch:8904
From: lew@gsg.UUCP (Paul Lew)
Newsgroups: comp.unix.programmer,comp.lang.c,comp.arch
Subject: Re: What would you like in a debugger?
Summary: define a standard so we dont have to learn every debugger..
Keywords: debugging
Date: 14 Aug 92 19:12:28 GMT
Organization: General Systems Group, Inc., Salem, NH

The most annoying problem of debuggers is everyone is different.  What we
need is a standard interface or 'common debugger protocol (CDP)' if you
will be defined and adopted by all the upperlayer debuggers.  If this
becomes a reality, then I can stay in my favorite codecenter and cross
debug a PC program with runaway pointers.  The PC debugging may finally
become interesting...  (I choose codeview and codecenter without any
specific purpose but illustrating an idea)

	+-------------+     X     +-----------------+
	| PC codeview |     X     | Unix codecenter |
	|     GUI     |---. X  .--|     X11 GUI     |
	+-------------+   | X  |  +-----------------+
	       | CDP      | X  |   CDP    | CDP
	       |	  .------------.  |
	       |     CDP    X  |       |  |
	       |    .----------.       |  |
	       |    |       X          |  |
	       V    V       X          V  V
	+-------------+     X       +------------+
	| PC codeview |     X       | Codecenter |
	|   backend   |     X       |   backend  |
	| runs on PC  |     X       |runs on Unix|
	+-------------+     X       +------------+
	   Microsoft	  network      Centerline
	    product			product
-- 
Paul Lew (lew@gsg.com)				  UUCP: uunet----+
General Systems Group, 5 Manor Parkway			oliveb---+--gsg--lew
Salem, NH 03079	(603) 893-1000				decvax---+
Xref: sparky comp.unix.programmer:4258 comp.unix.internals:1682 comp.sys.hp:9210
From: terry@thisbe.npd.Novell.COM (Terry Lambert)
Newsgroups: comp.unix.programmer,comp.unix.internals,comp.sys.hp
Subject: Re: inode to filename
Date: 12 Aug 92 18:17:07 GMT
Organization: Novell NPD -- Sandy, UT

In article <1992Aug12.144032.6417@bwdls61.bnr.ca>, mleech@bnr.ca (Marcus Leech) writes:
|> In article <1992Aug11.164753.13726@ssd.ukpoit.co.uk>, alan@ssd.ukpoit.co.uk (Alan Barclay) writes:
|> |> I don't see it as a weakness, if there was a one to one relationship
|> |> 
|> |>  [MS-DOS references delated].
|> |> I don't see the need to refer to a file from a inode number anyway,
|> |> the most common you can get a inode number is though stat or fstat,
|> |> and presumably you knew the filename in the past.
|> A common reason for wanting to do this is to determine what's going on in
|>   your system.  Which processes have which files open, etc.  This *is*
|>   useful, and UNIX has traditionally (and continues to be) weak in the areas
|>   of effective system management mechanisms.
|> 
|> The traditional argument for not storing such information in the kernel
|>   has been "too much space".  Memory is now quite cheap, and with clever
|>   data structures, you don't pay that much for keeping filename<--->process
|>   mappings around.  If, for example, you recognize that there is a very
|>   high degree of shared name space, you can take advantage of that fact to
|>   dramatically reduce the storage requirements.
|> 
|> In this *particular area*, VMS is better.

Then again, VMS is extent based, and uses a single allocation pointer.  This
means you not only serialize on the use of this pointer, multiple writers tend
to interleave extents, pretty much killing any benefits from extenting in the
first place.

VMS also has the ability to support hard links, which once again introduces the
parent/ancestor identification problem... which equivalent path to the file (and
which name for the file) did the user use when it was opened?

VMS also has a system-wide limit of 1024 channels, which aren't only used by the
file system.

VMS also does not have caching, per se.

The traditional argument for not storing the information in the kernel has been
reverse lookup overhead.

					Terry Lambert
					terry_lambert@gateway.novell.com
					terry@icarus.weber.edu

---
Disclaimer:  Any opinions in this posting are my own and not those of
my present or previous employers.
Newsgroups: comp.unix.programmer,comp.unix.questions
From: websterm@uproar.enet.dec.com (Mike Webster)
Subject: Re: Sockets: Non Blocking I/O, How do I know when its done?
Reply-To: Mike.Webster@ime.mts.dec.com
Organization: Digital Equipment Corporation
Date: Fri, 14 Aug 1992 09:58:10 GMT



 Eric,

 Check select() this will tell you when there is something on the
 fd(s) you are interested in, call it with a timeout if needed.

 or an ioctl() FIONREAD call will tell you how many bytes there
 are to read.

 Mike Webster London UK.
Newsgroups: comp.unix.programmer
From: adams@pdv2.fmr.maschinenbau.th-darmstadt.de (Adams)
Subject: Re: floating point math on a SPARC2
Date: Fri, 14 Aug 1992 23:35:36 GMT
Organization: TH-Darmstadt


Floating point on SS2 is done in C run time library and by a FPU
from Weitek.

best adams
Xref: sparky comp.unix.programmer:4309 comp.unix.internals:1693 comp.sys.hp:9307
From: terry@ithaca.Eng.Sandy.Novell.COM (Terry Lambert)
Newsgroups: comp.unix.programmer,comp.unix.internals,comp.sys.hp
Subject: Re: inode to filename
Date: 14 Aug 92 22:35:05 GMT
Organization: Novell NPD -- Sandy, UT

In article <JIM.92Aug14122954@hunter.cs.strath.ac.uk> jim@cs.strath.ac.uk (Jim Reid) writes:
>In article <1992Aug13.135735.6607@bwdls61.bnr.ca> mleech@bnr.ca (Marcus Leech) writes:
>
>   Granted there isn't always a 1 to 1 relationship between a files internal
>     "handle", and its name.  In the real world, programs refer to files by
>     name, and in the real world, system managers frequently need this
>     information either to debug some system process, or because they want to
>     take a disk offline, and they need to know which processes have *which*
>     files open on the disk.  You can avoid having to do the reverse mapping
>     simply by storing the name information in such a way as to be generally
>     useful, and not cost very much.
>
>Hmmm. On some machine there could be thousands of active files. Having
>the kernel maintain a list of those filenames might cost more than you
>think. [If it's a choice between assigning 100K of kernel memory to
>I/O buffers or process page tables or a list of active filenames, I
>wouldn't choose the list of filenames.]
>
>What would such a scheme do in the case of a process which unlinks an
>open file?

*Very* good point against keeping the data in the kernel.  There is also
the worse case of a file having been moved.  Not only is there not a file
where the kernel says it is, theres a file open that the kernel knows
is open but can't know it's new name.

If we return to the question of taking a device offline, I have to argue
that it is irrelevant whether or not you know the name of the file; you
only need to know the name of the processes which have files open on the
device; you could care less what the names of the files are.  Killing
the processes will kill the references.  You don't really care what *files*
are referenced ... you care what *devices* are referenced.

By traversing all active process structs in the kernel, one can get the u
structs for each process, and thus the pointer to the locked vnodes for that
process (this will be in the per process fd table and in the current working
directory pointer).  It's easy to find out what device or file system a
vnode is open to.  From this, you determine if you want to kill a particular
process that's holding your FS open.

Alternatively, most file systems support forcible unmount; you should
probably wall to tell your users to logout/kill their program/change to
a safe directory so as to give them fair warning that you may destroy one
or more of their files.  This is probably inferior to killing off the
processes and umounting, and killing again if that fails, repeating until
the thing unmounts, but it will certainly take less code (ie: no code)
in enough cases that it will be worthwhile.


					Terry Lambert
					terry_lambert@gateway.novell.com
					terry@icarus.weber.edu

---
Disclaimer:  Any opinions in this posting are my own and not those of
my present or previous employers.
Newsgroups: comp.unix.programmer
From: pete@achilles.arl (Peter Flugstad,,,)
Subject: Re: Process & Signal Question
Reply-To: pete@achilles.arl
Organization: Washington University, School of Engineering, St. Louis MO
Date: Tue, 18 Aug 1992 23:01:52 GMT

In article 4078@ringer.cs.utsa.edu, rrybacki@ringer.cs.utsa.edu (Richard M. Rybacki) writes:
>>In article <1992Aug18.145412.6352@wuecl.wustl.edu> pete@achilles.arl writes:
>>I don't know about Sys V, but Sun OS 4.1.1 lets you do this.  On several occasions I have 
>>installed a new executable for a running program and it's almost always resulted in 
>>Bus Errors...  Nothing worse than that though...
>
>If you are talking about a file which is being shared via NFS, this could
>happen, because NFS does not completely implement the UNIX file deletion
>semantics.  In the local filesystem case, this should not present a problem.
>I believe Sun tried to mitigate this by renaming the deleted file on the
>server side, but this does not help the case where two NFS clients are
>sharing a single executalbe from a common server.
>-- 
>                            Richard M. Rybacki
>                       rrybacki@ringer.cs.utsa.edu
>                              (512) 731-0000
>                          "Will consult for food"

Yes, that is how our system is set up.   And when we install/make a new executable on one client while
the program is running on another (or the same machine for that matter I think) it causes bus errors.
From: tigli@mimosa.unice.fr (Jean-Yves Tigli)
Newsgroups: comp.unix.programmer
Subject: Itimer
Date: 17 Aug 92 08:15:00 GMT
Organization: University of Nice-Sophia Antipolis

I work on a Sparc station, and I use "sys/time.h" .
Using "itimerval" type, I set timer value to generate
an interruption according to :

struct itimerval *value;

value=(struct itimerval*)malloc(10);

(value->it_interval).tv_sec=1;
(value->it_interval).tv_usec=0;
(value->it_value).tv_sec=1;
(value->it_value).tv_usec=0;

setitimer(timer,value,NULL);

When tv_sec > 0, it's OK but ,
when I try to generate an interruption before one second
( tv_sec = 0) and  tv_usec = ??,  my program emits it always
at the same time : about 10 ms, ignoring tv_usec value.

I think it's a classical problem (alarm() from UNIX library 
does it only with seconds), but I don't understand why ?

Do you know a work around ?

Thanks.

tigli@mimosa.unice.fr
I3S Laboratory, FRANCE
From: jackson@daimler.ucs.indiana.edu (Jeff Jackson)
Newsgroups: comp.unix.programmer
Subject: SIGPIPE Delivery on socket close
Keywords: SIGPIPE signal TCP socket
Date: 21 Aug 92 21:00:15 GMT
Organization: University Computing Services

Greetings,

I'm developing a server which needs to time out connections that are
inactive for some specified time. When the server detects that the
timeout period has elapsed, it closes the socket.

In the client, after the server has timed out and closed the socket,
I expected to get a SIGPIPE signal the next time I tried a write to 
the socket. What I am finding is that the first write that I do to
the socket completes normally - returning the number of bytes that
were written. Sometimes even the second write will appear to succeed.
Usually however the second or third write causes the SIGPIPE signal, which
is trapped and closes the socket. 

What needs to be done to get the SIGPIPE signal the FIRST time I write
to the socket? 

Thanks for any clues,

JLJ

-- 
+---------------------------------------------------------------------------+
| Jeff Jackson         (812) 855-8002       jackson@daimler.ucs.indiana.edu |
| Indiana University   Program for Distributed Computing   Unix Development |
+---------------------------------------------------------------------------+
Newsgroups: comp.unix.programmer
From: mahmood@lambda.msfc.nasa.gov (Rafique Mahmood)
Subject: Need the source code for rand() function.
Keywords: rand() funtion source code
Organization: NASA/MSFC
Date: Thu, 20 Aug 1992 15:41:57 GMT


I need the source code of rand() function call. If anyone has the source code or
can tell me where to find it I will appreciate that.

Please email the answer. Thanks.

Rafique J. Mahmood
email: mahmood@lambda.msfc.nasa.gov
From: erik@pdnfido.fidonet.org (Erik VanRiper)
Newsgroups: comp.unix.programmer
Subject: Re: another curses question
Date: 23 Aug 92 03:12:48 GMT
Organization: The Source for Source Pub Access Unix

In article <1992Aug20.134934.2156@vixvax.mgi.com> carpenter@vixvax.mgi.com writes:
>Another question from a curses neophyte:
>
>According to the man pages, a call to initscr() sets things up so
>that the first call to refresh() will clear the screen.  I'd like to
>create a window that occupies only the bottom line or two of the screen,
>and have everything else left alone.  Is there a way?

What about creating a WINDOW *win;, and only doing a wrefresh(win);?  Not
sure if that will work as you want, as I am not sure what you are going to do
or expect to do with the rest of the screen (stdscr).  


-- 
Like wow...  This be a .sig, eh? 
GEEKS Anonymous - Join today!
The Source for Source - Pub Access Unix.  (516) 968-7824 or (516) 666-5877
From: abmg@cathedral.cerc.wvu.wvnet.edu (Aliasghar Babadi)
Newsgroups: comp.unix.programmer
Subject: check if a program exists
Keywords: program
Date: 12 Aug 92 16:04:22 GMT

Hi,
	I have an application that requests form the user to input
a program name. I want to know if there is a way to check in a C program 
if the name that user entered is acutally a program name, before  executing
that program. User may enter a wrong program name I want to do the error
checking before taking further actions in the program. Thanks.
Newsgroups: comp.unix.programmer,comp.unix.internals
From: doi@jrd.dec.com (Hitoshi Doi)
Subject: Re: debugging streams
Organization: DEC Japan Research and Development Center
Date: Thu, 13 Aug 1992 22:32:47 GMT

In article <35489@arctic.nprdc.navy.mil>, stanonik@nprdc.navy.mil (Ron Stanonik) writes:
# We're trying to track down a problem with a serial port.

[..stuff deleted here and there..]

# We'd like to "see" what's being passed between ldterm and fxm.
# ldterm and fxm don't seem to be strlog'ing anything; ie, neither
# strace nor sterr produce any output.  Is there anything we can push
# between ldterm and fxm to "see" what's being passed?

It is very easy to write a filter module that you can push anywhere
that will strlog (or printf) the messages that are going around.
Something like the following.  Please add details to suit your needs.

mfilter_open(..)  { return 0; }
mfilter_close(..)  { return 0; }
mfilter_rput(queue_t *q, mblk_t *mp)
{
    struct iocblk *iocp;
    switch (mp->b_datap->db_type) {
    case M_DATA:
        strlog(MID, SID, 0, 1, SL_ERROR, "READ: M_DATA: %d chars",
            mp->b_wptr - mp->b_rptr);
        break;
    case M_IOCNAK:
        iocp = (struct iocblk *)mp->b_rptr;
        strlog(MID, SID, 0, 1, SL_ERROR, "READ: M_IOCNAK: %x", iocp->ioc_cmd);
        break;
    case M_IOCACK:
        iocp = (struct iocblk *)mp->b_rptr;
        strlog(MID, SID, 0, 1, SL_ERROR, "READ: M_IOCACK: %x", iocp->ioc_cmd);
        break;
    ....
    }
    putnext(q, mp);
    return 0;
}
mfilter_wput(queue_t *q, mblk_t *mp)
{
    struct iocblk *iocp;
    switch (mp->b_datap->db_type) {
    case M_DATA:
        strlog(MID, SID, 0, 1, SL_ERROR, "WRITE: M_DATA: %d chars",
            mp->b_wptr - mp->b_rptr);
        break;
    case M_IOCTL:
        iocp = (struct iocblk *)mp->b_rptr;
        strlog(MID, SID, 0, 1, SL_ERROR, "WRITE: M_IOCTL: %x", iocp->ioc_cmd);
        break;
    ....
    }
    putnext(q, mp);
    return 0;
}

--
Hitoshi Doi, International Open Systems Engineering        doi@jrd.dec.com
Japan Research and Development Center               decwrl!jrd.dec.com!doi
Digital Equipment Corporation Japan          [from Japan: doi@dec-j.co.jp]
From: samari@watnxt2.ucr.edu (Tammy Woodley)
Newsgroups: comp.unix.programmer
Subject: Sudo
Date: 20 Aug 92 19:53:27 GMT
Reply-To: samari@watserv.ucr.edu
Distribution: usa


Hi all,

  I'm not too sure if this is the right place to post, but I have a question
about "sudo".  I read about it in a unix manual, and would like to use it
on one of my systems (an E&S to be precise).  Unfortuneatly, it doesn't
seem to be recognized by my machine.  Could it possibly be that my version
of unix is too old, or do you have to ftp it from somewhere?  Or perhaps I 
am not doing it right.  
  
   Any and all help would be appreciated.


P.S. I'm a novice to sys admin, and learning as I go along, so please, no  
flames
:)  Thanks.

--
-------------------------------------------------------------------------------
Tammy Woodley (student)      | " It's not I who am crazy.....
UC Riverside                 |   It's I who am MAD!!!!.......
Samari@watserv.ucr.edu or    |   We're not hitch hiking anymore....
Samari@psychophysics.ucr.edu |   We're riding!!!!!!"
-------------------------------------------------------------------------------
From: mse@ttsi.lonestar.org (Mark Evans)
Newsgroups: comp.unix.programmer
Subject: Re: Yielding a Timeslice
Date: 20 Aug 92 13:28:24 GMT
Organization: st

In article <1992Aug19.184837.24219@news.weeg.uiowa.edu> schwaigr@news.weeg.uiowa.edu (Jim Schwaiger) writes:
>Is there a standard (or commonly accepted) way for a program to yield
>its timeslice?  I have a program which checks on a condition in shared
>memory and would like to sleep (for less than 1 second) if that condition
>is not met, rather than waiting in the "hot" loop.
>
>Jim Schwaiger

I asked the same question recently.  There is no universal facility
across unices.  There is a Posix-defined facility named yield()
that some systems support.  If you are running on SVR4, you might 
also look at priocntl(2).  It advertises, for real-time class processes,
the ability to "go to the back of the scheduling queue at the same
priority by resetting its rt_pri value to its current real-time
priority value."  An associate played with this briefly and observed
some very screwy behavior---a long 30ms average delay before returning.
We have no idea what's going on.  

Also look at select() (BSD) or poll() (SVR[34]) which you can use
to implement a higher granular sleep based upon the system tick
frequency, which is usually 60 or 100 HZ.  
-- 
Mark S. Evans                 Tandem Telecommunications Systems Inc.
Phone: 214-516-6201           1255 W 15th St.
Fax:   214-516-6805           Plano, TX 75075
Mail:  mse@ttsi.lonestar.org
From: guy@Auspex.COM (Guy Harris)
Newsgroups: comp.unix.programmer
Subject: ETXTBSY on open for write (was Re: Process & Signal Question)
Date: 19 Aug 92 04:13:12 GMT
Organization: Auspex Systems, Santa Clara

>If you are talking about a file which is being shared via NFS, this could
>happen, because NFS does not completely implement the UNIX file deletion
>semantics.

Well, that's not the *only* reason it can happen.  It can also happen if
you copy stuff to a file, as well; even if the system running the
program won't let you open a shared executable for writing if some
process is running from it, a process on some other system - another
client of the same server, or the server itself if the process running
from the file is on a client - could write to the file.

In SunOS 4.x and, I think, SVR4, the system *will* let you open a shared
executable for writing even if some process on the same machine is
running from it.  It might be possible to implement the more
"traditional" semantics, but to properly generalize it, it'd have to
work on shared libraries as well, which'd probably mean that:

	1) the run-time linker would have to use some call other than
	   "mmap()" to map in the shared libraries, or would have to use
	    some special flag to "mmap()";

	2) the system would have to decide that anybody mapping
	   something copy-on-write wants to prevent anybody else from
	   opening the file for writing (you don't have to open a file
	   for writing to map it writable, as long as you're mapping it
	   copy-on-write as well).
Newsgroups: comp.unix.aix
From: ccvj@misty.latrobe.edu.au (Vicki Jordan)
Newsgroups: comp.unix.aix
Subject: man problems - nfs from V3.2 to V3.1 machine
Keywords: slow
Date: 18 Aug 92 01:33:37 GMT
Organization: La Trobe University


We upgraded  one machine to V3.2.  It has a cdrom with info and man on
it and it is nfs mounted to another machine still at 3.1.5.  When doing
a "man" on the 3.1 machine, the characters are painted on the screen so
slowly - its worse than a 300 baud modem line!  It "appears" that there
may be related to escape characters since options (with all the left
and right braces) are slow and new paragraphs lose the first character.

Has anyone else experienced this?  Does anyone know how I can track down
the problem? Will it go away if we upgrade the second machine?

And, as someone else mentioned, accessing the cdrom is really much
slower than with 3.1, even on the same machine!


Vicki Jordan





-- 
Vicki Jordan                               ccvj@misty.latrobe.edu.au
Computing Services
La Trobe University 
Bundoora Vic 3083 Australia
Newsgroups: comp.unix.aix
From: e-sink@uiuc.edu (Eric W. Sink)
Subject: Can I build static executables under AIX 3.2 ?
Originator: sink@ux2.cso.uiuc.edu
Reply-To: e-sink@uiuc.edu
Organization: University of Illinois at Urbana
Date: Thu, 13 Aug 1992 14:25:59 GMT

How do I build an app which does NOT use shared libraries ?

-- 
Eric W. Sink, Spyglass        | [ Cute quote deleted ]
1800 Woodfield Drive          |
Savoy, IL  61826              |
---- e-sink@uiuc.edu ---------|---------- 217-355-6000 -----------------------