Descriptors (sending this mail again, the first did not make it?)

Descriptors (sending this mail again, the first did not make it?)

Post by Daniel Blankensteine » Thu, 23 May 2002 17:39:29



Hi FL (FreeBSD lovers ;-)

I am reading about socket programming and the author wrote
that a socket is given a descriptor, like when you open a file
you get a file descriptor. The descriptors are given from the
same table, so a file and a socket can't get the same descriptor.
That is all fine, but then I run sockstat on my FreeBSD 4.5 Stable,
I get:
db# sockstat -4 -l
USER COMMAND    PID   FD PROTO  LOCAL ADDRESS  FOREIGN ADDRESS
root            centeric           696     8    tcp4               *:49158
*:*
root            XF86_SVG     637     0    tcp4               *:6000
*:*
root            sshd            82      4    tcp4                *:22
*:*
root            amd                  72      4    udp4               *:1023
*:*
 root           amd                  72      5    tcp4                *:1023
*:*
root            amd                  72      6    udp4              *:1022
*:*
root            amd                  72      7    udp4              *:1021
*:*
daemon      portmap            70      3    udp4               *:111
*:*
daemon      portmap            70      4    tcp4                *:111
*:*
root        syslogd         67     5    udp4                *:514
*:*

Why do some have the same FD (file descriptor)?

It is said that everything in unix is a file, but it there someway you can
see if a descriptor is a file or socket?

br
db

 
 
 

Descriptors (sending this mail again, the first did not make it?)

Post by Henri Henneber » Thu, 23 May 2002 21:29:23




Quote:> Hi FL (FreeBSD lovers ;-)

> I am reading about socket programming and the author wrote
> that a socket is given a descriptor, like when you open a file
> you get a file descriptor. The descriptors are given from the
> same table, so a file and a socket can't get the same descriptor.
> That is all fine, but then I run sockstat on my FreeBSD 4.5 Stable,
> I get:
> db# sockstat -4 -l
> USER COMMAND    PID   FD PROTO  LOCAL ADDRESS  FOREIGN ADDRESS
> root            centeric           696     8    tcp4               *:49158
> *:*
> root            XF86_SVG     637     0    tcp4               *:6000
> *:*
> root            sshd            82      4    tcp4                *:22
> *:*
> root            amd                  72      4    udp4
*:1023
> *:*
>  root           amd                  72      5    tcp4
*:1023
> *:*
> root            amd                  72      6    udp4              *:1022
> *:*
> root            amd                  72      7    udp4              *:1021
> *:*
> daemon      portmap            70      3    udp4               *:111
> *:*
> daemon      portmap            70      4    tcp4                *:111
> *:*
> root        syslogd         67     5    udp4                *:514
> *:*

> Why do some have the same FD (file descriptor)?

The rule is different FD for the same process, but 2 processes have
different file tables. for each process, FD 0 is allways stdin, FD 1
stdout and FD 2 stderr.
Quote:

> It is said that everything in unix is a file, but it there someway you can
> see if a descriptor is a file or socket?

man stat is the answer.

Henri

- Show quoted text -

Quote:

> br
> db


 
 
 

Descriptors (sending this mail again, the first did not make it?)

Post by Daniel Blankensteine » Thu, 23 May 2002 21:33:26



Quote:> > Why do some have the same FD (file descriptor)?
> The rule is different FD for the same process, but 2 processes have
> different file tables. for each process, FD 0 is allways stdin, FD 1
> stdout and FD 2 stderr.

> > It is said that everything in unix is a file, but it there someway you
can
> > see if a descriptor is a file or socket?
> man stat is the answer.

Ok, thanks :-)

br
db

 
 
 

1. Mail Not Sent Sending error: 451 queuename: Cannot create

I have a redhat 5.1 Linux box handling mail and web traffic for a small
network. It runs great, mail from Windows clients using POP/SMTP works
fine. I just have problems sending mail if I telnet in and use pine or
other console mail progs. Unless I am logged in as (or su'd to) root I get
the following errors.

In Pine

[Mail not sent. Sending error: 451 queuename: Cannot create "qfPAA14279]

In /var/log/messages

Sep 24 15:26:45 machinename sendmail[14285]: NOQUEUE: SYSERR(username):
queuename: Cannot create "qfPAA14279" in "/var/spool/mqueue" (euid=525):
Permission denied

I tried chmod +w /var/spool/mqueue just to see if it changed things - made
no difference to the problem.. so put the correct permissions back.

Any Ideas?

Thanks

Andy

------------------  Posted via CNET Linux Help  ------------------
                    http://www.searchlinux.com

2. install problem

3. sending data from one file descriptor to many

4. Do nothing

5. Can send mail out but can't send mail in?

6. URGENT! ip:spinning error - OSE 5.0.2

7. Help! Sending mail But not Receiving mail!

8. What version of the kernel fixes these VM issues?

9. mail.aliases does not exist - errors sending mail

10. For Help:sendmail can not send mail to a lotus mail server

11. sendmail mail server does not accept sending mail from remote clients

12. do_ypcall: clnt_call: RPC: unable to send; errno =not valid file descriptor

13. How to send mail offline? (Again)