HDTenEightyP/NetNews huggingface dataset:
From: jg@cs.brown.edu (Jeremy Gaffney)
Subject: Re: client/server question...........
Organization: Brown Computer Science Dept.
Date: Thu, 28 Jan 1993 23:08:52 GMT

In article <1993Jan26.222115.28187@slate.mines.colorado.edu>, iarit@slate.mines.colorado.edu (ARIT ISMAIL) writes:
|> Hi,
Hi.
|> 
|> I don't know if this is the right place to post this, but
|> I need some help about writing a simple client/server program.

Comp.unix.questions is usually a better forum for 
questions of this level.  I also highly recommend 
getting W. Richard Stevens' Unix_Network_Programming, 
which is an excellent reference with a large amount of
robust source code included.  The book is the best networking
reference I have seen.  It will be a well-spent $50.

|> 
|> Here is what I am trying to do;
|> 
|> I want to write a program that will accept connections from
|> other programs and will communicate with them without forking.
|> I don't want to fork because the info should be generated on one
|> program, send to server and the server has to respond to every
|> program connected with the same info( if I fork, how  can I transfer
|> that info to child?).

Shared memory. Sockets. Pipes.  Man pages are:

shmctl (2)              - shared memory control operations
shmget (2)              - get shared memory segment identifier
shmop, shmat, shmdt (2) - shared memory operations

for shared memory,

socket(2), connect(2), et al. for sockets, and 

pipe (2V)               - create an interprocess communication channel
popen, pclose (3S)      - open or close a pipe (for I/O) from or to a process

for pipes.  These three are common and reasonably portable. 

|> 
|> while(1)
|> {
|>  check_new_connection(); /* how can I check if there is any new
|> connection
|>                            without waiting, as far as I know accept(..)
|>                            blocks you 'till you get some connection*/
|>  check_clients();       /* I can do these, no problem. read if there is
|>                            any new info */
|>  if(thereIsNewInfo)
|>    inform_clients();     /* if I can create a list of handles for clients
|>                            this is no big deal */
|> 
|> }
|> My problem is getting new connections without waiting.

To get new connections without waiting, you can set the socket to
be non-blocking using the ioctl or fnctl calls, like so:

#include <sys/ioctl.h>
#include <errno.h>

char foo=(char) 1;

if (ioctl(sockfd, FIONBIO, &foo  ) < 0)
	printf("Error setting socket %d with code: %d", sockfd, errno);

The third argument is a char * which is expected to point
to the argument to ioctl; arg needs merely to be non-zero in
this case to set nonblocking IO for sockfd.

|> 
|> I appreciate any help.
|> 
|> iarit@slate.mines.colorado.edu

Anytime.
-jg
-- 
/*  Jeremy Gaffney [jg@cs.brown.edu gaffer@brownvm.brown.edu] */
Newsgroups: comp.unix.wizards,comp.org.eff.talk,comp.org.usenix,comp.unix.bsd,alt.suit.att-bsdi
From: davecb@nexus.yorku.ca (David Collier-Brown)
Subject: Re: Discussion at Usenix (was Bad News for Human Beings)
Organization: York University
Date: Thu, 21 Jan 1993 19:26:56 GMT

sl@wimsey.bc.ca (Stuart Lynne) writes:
|Given the importance of presenting a positive image at a large trade
|show and the $$$ spent to achieve it, you can bet that two things would
|happen. First you *would* get noticed. And second you would probably be
|escorted off the premises.

|This may have some of the desired effect of course. Especially if the
|trade press noticed.

  I was at the spring Interop, where a stagefull of PC-droids tried
to convince a roomfull of experienced computer centre directors
that their favorite version of non-interoperable PC mail was the
right answer for the whole world.

  They got shouted at, laughed at and described in uncomplimentary terms
by a bunch of suits.
  They took notice.

  Mind you, one company just started an advertizing campaign agains
interoperability, but they **did** notice.  

  And no-one was asked to leave: after all, we **were** the paying customers.

--dave
-- 
David Collier-Brown,  | davecb@CCS.YorkU.CA | lethe!dave
72 Abitibi Ave.,      | 
Willowdale, Ontario,  | York postmaster and
CANADA. 416-223-8968  | occasional sendfail(8) consultant.
From: bimal@andersen.co.uk (Bimal Shah)
Newsgroups: comp.unix.wizards
Subject: sendmail.cf configuration
Summary: none
Keywords: none
Date: 21 Jan 93 14:51:36 GMT
Organization: Andersen Consulting (UK Practice)

Does anybody know of a cuspy source for sendmail.cf configuration ?
Newsgroups: comp.unix.wizards,comp.sys.sun.hardware,comp.unix.solaris
From: mak@tgivan.wimsey.com (Bob Makowski)
Subject: serial i/o, bangs, buffers, bleary eyes...
Followup-To: poster
Keywords: interrupts serial dma priority buffered i/o
Reply-To: mak@tgivan.wimsey.com
Organization: TGI Technologies Ltd.
Distribution: na
Date: Wed, 27 Jan 1993 06:11:08 GMT

It's time for a bleary eyed dump of some questions I'm interested in
hearing answered. These focus on some thought experiments about the
(Sun/sparc) serial ports. I'm assuming outbound modem i/o in all cases below.

(I hope these questions aren't too cryptically worded.)

	* stty says: raw, clocal, cread. Will this CPU interrupt per character?

	* canonical processing does not translate into one interrupt per
	character? (Certainly flush happens with new lines, and echoing is
	documented in termio(4) as immediate. So please contrast here.)

	* tty interrupt priority vs. SCSI bus interrupts. How do they
	compare logically?

	* how much write(2) i/o before get flow control from serial device,
	not the DCE.

	* fwrite(3) should allow more than write(2), yes?

	* does the device driver dma (written) data onto the serial line
	driver/chip. 
	
		+ If so, does the dma need to terminate on a page aligned
		boundary, as with other (e.g., intel) dma character
		devices.

		+ Corollary: nonpage aligned portions are copied in/out, else
		direct dma from page aligned portions of a process' true
		buffer.

		
I would deeply appreciate e-mailed answers, and I will try posting a
cogent summary.

Thanks in advance,
= Mak
Newsgroups: comp.unix.msdos,comp.unix.questions,alt.msdos.programmer,comp.os.msdos.programmer
From: gurgle@netcom.com (Pete Gontier)
Subject: SUMMARY: UNIX-style links under MS-DOS
Followup-To: poster
Keywords: link DOS unix
Organization: cellular
Date: Wed, 27 Jan 1993 19:41:49 GMT

I don't remember if I promised a summary, but I got such
high-quality repsonses that I figured I owed one.
 
My problem was this: due to #include file directory search
limitations of typical DOS C compilers (Borland, Microsoft), our
highly hierarchical source structure was giving us fits. We were
trying to specify too many directories for the compiler to search;
the command line was full and the relevant environment variable(s)
was (were) full.
 
I was hoping that someone had hacked DOS to support UNIX-style
links. I could then create a directory and fill it with links to
files deeply nested in our hierarchy. I could then instruct the
compiler to look in only that one place for #include files.
 
It turns out that this is: 1) not necessary, 2) not possible. :-)
 
DOS apparently maintains in its directory a direct reference to a
file's location on disk. (UNIX uses an indirect reference.) If one
were to create a "link" under DOS, it would point to the right
place on the disk only until the file were modified. DOS would
dutifully update the file's "real" directory entry, and the link
would get stale. The DOS tool CHKDSK would eventually complain and
try to "fix" the link.
 
Another possibility I imagined might work would be to patch DOS
with a TSR (terminate-and-stay-resident program). Several people
wrote to tell me this would be compatibility hell, in terms of both
other hacks and Windows, which doesn't necessarily go through
official DOS file system channels when it wants to mess with the
file system.
 
A good suggestion, put foward by several people, was to use the DOS
SUBST or JOIN command in whatever way was appropriate. Apparently
SUBST lets you assign a drive letter to an arbitrary directory,
which means I could "alias" C:\FOO\BAR\BAZ\QUUX to Q:.
Specifying Q: to the compiler would be a lot shorter than the
pathname. Apparently JOIN is similar to UNIX mount.
 
Another good suggestion, put forward by several more people, was to
create dummy header files in one directory. A file called "QUUX.H"
might contain 
 
	#include "\FOO\BAR\BAZ\QUUX.H"
 
Several schemes were mentioned which allowed one to at least
partially automate the creation of these dummy header files,
inlcuding using the DIR /S command in various ways.
 
Thanks to all who responded.
 
P.S. Some people 1) suggested that the next version of DR DOS might
support links. 2) told me that they were working on a relatively
safe method for creating links under DOS. Keep your eyes and ears
open for both.

-- 
 Pete Gontier // EC Technology // gurgle@netcom.com
Newsgroups: comp.unix.programmer
From: bhpowell@unccsun.uncc.edu (Bradley Heath Powell)
Subject: need help with UNIX/SPARC/ptrace() single stepping...
Organization: University of NC at Charlotte
Date: Wed, 27 Jan 1993 21:02:08 GMT



I am having GREAT difficulty finding information related to a academic project
that I am working on...can anyone help me???

THE SYSTEM:
   Sun SPARCstation 2
   SunOS 4.1.3  (very similar to UNIX)

THE PROJECT:
   I am writing a program that will record its child process' references to 
memory addresses: i.e. every time the child process executes a load or store 
machine instruction, the parent needs to write the address referenced and its 
contents to a file.  Its purpose is to profile and evaluate the efficiency of 
a process by examining its load and store instructions.

SOME QUESTIONS:
- How does one (or can one...) implement single step debugging in C with 
  ptrace(), wait(), signal(), exec(), etc... under SunOS/UNIX?

- Where can I find information about the SPARC processor, particularly info.
  on encoding and decoding instructions? (yes, I've read the man pages and the
  answer book, and contacted Sun...but not enough info!)

- Where can I find a comprehensive tutorial on SPARC assembly language?

PLEASE HELP
   I would greatly appreciate any help that anyone can offer...please send 
email to the address below.  I particularly need info. on where I can get
books and sample code.


Thanks-

Brad Powell
email: bhpowell@unccsun.edu
From: ray@rann.sbi.com (Raymond Blum)
Newsgroups: comp.unix.programmer
Subject: Re: Need Some Help
Date: 22 Jan 93 17:58:28 GMT
Reply-To: ray@rann.sbi.com
Organization: Salomon Inc.

>Hi netters,
>
>       I am working on developing some unix based e-mail tool. So I was wondering if any of the netters  know any books or location of some software which will be of some help to me. I need to use "socket" feature of unix to read and write messages to and from other sites.
>  
>       Any Help In This Matter Is Greatly Appreciated
>
>       Thanks In Advance
>    
>      
>Moin



A quick five minute intro to IPC programming using sockets is in the book "Berkeley Unix A Simple and Comprehensive Guide" by James Wilson. This book has a REALLY terse explanation and examples but it was a good start on the subject for me.
---Raymond
---
-------------------------------------------------------
-----                               __   ___       ----
-----                        . o  _/  \_/   \_     ----
----                  \\\\\\\    O   Hey!     \    ----
----                 \\\    \\   | why AM I    |   ----
----                  \\ O O     \_ smiling? _/    ----
----                               \__/\____/      ----
----                     \_/                       ----
----                                               ----
----   Raymond Blum                                ----
----   ray@rann.sbi.com                            ----
----   (201) 896-7594                              ----

  Of course these are MY opinions! Whattya think, my EMPLOYER 
  could've thought this stuff up?
From: gor@cs.strath.ac.uk (Gordon Russell)
Newsgroups: comp.unix.programmer
Subject: Networking Package
Date: 26 Jan 93 09:33:54 GMT
Organization: Comp. Sci. Dept., Strathclyde Univ., Glasgow, Scotland.


  Does anyone have a networking library which would support connectionless
datagrams, delivery reliably (ie through retransmission), allowing packet
sizes greater than the maximum ethernet packet size? I am just about to write
such a library, and would rather not reinvent the wheel.

 I am using an Unix system (sun4 sparc), and am writing the application in
C. The network is ethernet.  Any help appreciated, and feel free to email me.

 Gordon


+--------------------------------+-------------------------------------------+
|  Gordon Russell                |  EMAIL     : gor@cs.strath.ac.uk          |
|  L13.13a, Livingstone Tower,   |  TELEPHONE : 041-552-4400   Ex 3703       |
|  University Of Strathclyde,    |  FAX       : 041-552-0775                 |
|  26 Richmond Street,           +-------------------------------------------+
|  Glasgow, G1 1XH               | Spelling mistakes within this document are|
|  Scotland, UK                  | caused by internet compaction algorithms. |
+--------------------------------+-------------------------------------------+
From: skarkada@ha12.eng.ua.edu (Sudarshan Karkada)
Newsgroups: comp.unix.programmer
Subject: realloc question
Date: 24 Jan 1993 12:23:40 -0600
Organization: UTexas Mail-to-News Gateway
NNTP-Posting-Host: cs.utexas.edu


Hi,

I am in need of a function similar to 'realloc(2).'  I was planning
to use the 'realloc(2)' function but I found that man page for
realloc says ...

    Note: The realloc protocol is provided for source code compata-
    bility with old System V applications  and  should  be avoided in
    new applications.

Question: Is there an equivalent function for realloc?  Or, should
I code my own realloc?

I am using IBM RS/6000.
Please reply to skarkada@buster.eng.ua.edu

Thanks for your attention.
__________
Sudarshan.
skarkada@buster.eng.ua.edu
Newsgroups: comp.unix.programmer
From: brendle@ise.fhg.de (Axel Brendle)
Subject: Re: Can you place an obj/exe file under RCS?
Keywords: rcs RCS
Organization: FhG-ISE - Institute for Solar Energy Systems
Date: Mon, 25 Jan 93 09:47:33 GMT

knaru@gumby.Altos.COM (Kim Naru) writes:



>I have a question regarding RCS, in particular the version developed by
>Walter F. Tichy at Purdue University. The question is as follows :


>		1) Can obj code/executables be placed under RCS, if so
>		   what is the exact command?
.
. (deleted)
.

>--kim

I can 't tell you anything to the RCS your are using, but with the GNU-RCS
and GNU-DIFF it its possible to do what you  want.

Axel

----------------------------------------------------------------------------
Axel Brendle     MAIL: Fraunhofer Institute for Solar Energy Systems
                        Oltmannsstr. 22
                        D 7800 Freiburg, West Germany
                 PHONE: +49 (761) 4014 127    FAX: +49 (761) 4014 200
                 EMAIL: brendle@ise.fhg.de
----------------------------------------------------------------------------
Xref: sparky comp.unix.programmer:6024 comp.unix.questions:15834 comp.unix.wizards:5602
From: tal@netcom.com (Tal Dayan)
Newsgroups: comp.unix.programmer,comp.unix.questions,comp.unix.wizards
Subject: 8 Bit transparent connection with remote Unix, how ?
Date: 22 Jan 93 05:47:24 GMT
Followup-To: poster
Organization: Netcom - Online Communication Services  (408 241-9760 guest)


When call Unix A (Sparc 4) from my PC using a modem (asynchronous, 8
bits), I am able to run programs such as NCD Remote X (serial edition)
and Zmodem transfer protocol.

However, when I dial up to machine A and then Telnet to machine B (Sparc
4 as well), Zmodem and NCD Xremote fail to work.  I suspect that the
problems
is in the Telnet which does not provide a transparent full 8 bit
(binary) connection but intercept and maps some chars.

Is there a way to have a transparent 8 bit connection between the PC and
the shell in B (via A) ?  Can I use Telnet ? Should I write
a special program for that (TCP/IP connection ?) ?

Any help would greatly appricieted,

Thanks in advance,

Tal Dayan

tal@netcom.com


-- 

 =======================================================================
 Tal Dayan (TM)             tal@netcom.com              tal@cse.ucsc.edu 
 =======================================================================
From: tasos@cs.bu.edu (Anastasios Kotsikonas)
Newsgroups: comp.unix.programmer
Subject: Re: longjmp() from a signal handler
Keywords: longjmp signals
Date: 27 Jan 93 18:04:05 GMT
Organization: Computer Science Department, Boston University, Boston, MA, USA

In article <rturner.728076215@imagen> rturner@imagen.com (Randy Turner) writes:
#   the the jmp_buf[] references.  The POSIX.1 spec says that only a subset
#   of library calls are safe to call from inside a signal handler, and the
#   longjmp()/siglongjmp() calls are not among them.  I was curious if
#   Sys-V/R4 supports longjmp'ing from a signal handler, or is anyone has
#   code that does this?

Yes it does support it and it works fine; the same code actually works fine
on SUN/HP/IBM/SGI/Stardent/DG under BSD, SVR3 and SVR4.

Anyone interested, email me.

Tasos
Newsgroups: comp.unix.programmer
From: michaelh@g2syd.genasys.com.au (Michael Haldey)
Subject: Re: longjmp() from a signal handler
Keywords: longjmp signals
Organization: Genasys II, Sydney, Australia
Date: Thu, 28 Jan 1993 01:53:53 GMT

In article <rturner.728076215@imagen> rturner@imagen.com (Randy Turner) writes:
...
>   But from within a signal handler, even siglongjmp() is not compatible.
>   I think the problem stems from the fact that signal delivery is an
>   implementation-specific issue and that POSIX cannot guarantee that the
>   runtime stack the signal is delivered on is the same runtime stack that
>   the the jmp_buf[] references.  

You can specify alternative stack, there are ways to do it.

>   				   The POSIX.1 spec says that only a subset
>   of library calls are safe to call from inside a signal handler, and the
>   longjmp()/siglongjmp() calls are not among them.  I was curious if
>   Sys-V/R4 supports longjmp'ing from a signal handler, or is anyone has
>   code that does this?
>				Randy

Absolutely correct, but the reason is not in the stack.

Michael
-- 
Michael Haldey  |  Genasys II Pty Ltd, Sydney, Australia
                |  Phone:    +61-2-954-2878 (-9930 FAX)
                |  Internet: michaelh@g2syd.genasys.com.au
Newsgroups: comp.unix.programmer
From: meissner@osf.org (Michael Meissner)
Subject: Re: longjmp() from a signal handler
Organization: Open Software Foundation
	<rturner.728076215@imagen> <108515@bu.edu>
Date: 28 Jan 93 14:51:16

In article <108515@bu.edu> tasos@cs.bu.edu (Anastasios Kotsikonas) writes:

| In article <rturner.728076215@imagen> rturner@imagen.com (Randy Turner) writes:
| #   the the jmp_buf[] references.  The POSIX.1 spec says that only a subset
| #   of library calls are safe to call from inside a signal handler, and the
| #   longjmp()/siglongjmp() calls are not among them.  I was curious if
| #   Sys-V/R4 supports longjmp'ing from a signal handler, or is anyone has
| #   code that does this?
| 
| Yes it does support it and it works fine; the same code actually works fine
| on SUN/HP/IBM/SGI/Stardent/DG under BSD, SVR3 and SVR4.

However this discussion is missing the main point (at least as far as
I'm concerned) about longjmp'ing from within signal handlers.  Because
signals are delivered asynchronously, you could be in the library (or
your own code), and be interrupted at the wrong time.  For example,
consider an implementation of malloc that uses a doubly linked list to
hold the free list.  If you are in the middle of calling malloc, your
function may have updated one pointer, but was interrupted before the
other pointer was stored.  Thus your heap is now corrupted, but the
symptoms may not show for a while, but when it does WHAMO.  It may be
that 999,999 times out of a million you are safe, but that doesn't
mean you should blythly write code that fails at unpredictable times.
--
Michael Meissner	email: meissner@osf.org		phone: 617-621-8861
Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142

You are in a twisty little passage of standards, all conflicting.
From: guy@Auspex.COM (Guy Harris)
Newsgroups: comp.unix.programmer
Subject: Re: realloc question
Date: 24 Jan 93 20:27:46 GMT
Organization: Auspex Systems, Santa Clara

>    Note: The realloc protocol is provided for source code compata-
>    bility with old System V applications  and  should  be avoided in
>    new applications.
>
>Question: Is there an equivalent function for realloc?  Or, should
>I code my own realloc?

No, because the above statement from the AIX "malloc" man page is *not*
saying that the "realloc()" *routine* is provided for source-code
compatibility with old System V applications (and yes, the man page on
an AIX 3.2 system here really *does* misspell "compatibility"!); there's
no way IBM could get away with nuking "realloc()", given that it's in
the ANSI C standard.

The preceding paragraph says:

  The realloc subroutine supports the old realloc protocol wherein
  the realloc protocol returns a pointer to a previously freed
  block of memory if that block satisfies the realloc request.  The
  realloc subroutine searchs a list, maintained by the free subrou-
  tine, of the ten most recently freed blocks  of  memory.   If the
  list does not contain a memory block that satisfies the specified
  Size parameter, the realloc subroutine calls the malloc subrou-
  tine.  This list is cleared by calls to the malloc, calloc, or
  realloc subroutines.

*That*'s the old protocol to which it's referring; i.e., with the
traditional UNIX memory allocator, you could grow a block of mallocated
memory by doing:

	free((char *)pointer_to_block);
	pointer_to_block = (thing *)realloc((char *)pointer_to_block,
	    new_size_of_block);

and the pointer you got back from "realloc()" would point to a block
that contained the same data that was in the block you freed in the
"free()" call.

What IBM is saying is that *new* applications should, instead, do:

	pointer_to_block = (thing *)realloc((char *)pointer_to_block,
	    new_size_of_block);

to grow the block, *without* doing the "free()".
Newsgroups: comp.unix.programmer