1833100 Members
3750 Online
110051 Solutions
New Discussion

system call standards

 
shaick_1
Occasional Advisor

system call standards

Hello All,

I have doubt, from a accept system call man page,
accept(2) accept(2)

NAME
accept - accept a connection on a socket

SYNOPSIS
#include

AF_CCITT only
#include

int accept(int s, void *addr, int *addrlen);

_XOPEN_SOURCE_EXTENDED only (UNIX 98)
int accept(int s, struct sockaddr *addr, socklen_t *addrlen);

Obsolescent _XOPEN_SOURCE_EXTENDED only (UNIX 95)
int accept(int s, struct sockaddr *addr, size_t *addrlen);

Here, UNIX 95 is X/open single unix specification. Unix 98 is X/open single unix spec version2.

Now my question is,

1. Posix also has same specification for these socket calls, so no separate prototype is needed - am I right.

2. Why there X.25 protocol specification is given, Is this a separate standard ?

3. When this call is used which prototype is will be used. I guess X.25 protocol standard is used.

4.I guess if we use -DXOPEN_SOURCE_EXTENDED compile option then UNIX 98 will be used. am I right?

5. If 3 and 4 are correct ,then Why HP-UX default allow X.25 protocol standard then Posix /Xopen. So when user want these standard he/ she needs to compile the source with -DXOPEN_SOURCE_EXTENDED - am I right.

Please educate me on this.

Thanks,
Shaick.
2 REPLIES 2
Muthukumar_5
Honored Contributor

Re: system call standards

Hai Shaick,

Let me give a analysis to calrify your question(s).

Question 1:

POSIX are using AF_LOCAL, AF_INET, AF_INET6, and AF_ROUTE domain families. Call parameter count is same. But the parameter value is differed.

Unix98 type socket address length will not grow in future.

Unix95, in future implementations, we may choose to limit the size to 32 bits in both 32-bit and 64-bit data models.

Posix are using int accept(int s, void *addr, int *addrlen); format and X/open is using int accept(int s, struct sockaddr *addr, *) (other two format)

Question 2:

X.25 protocol is separated one, and used to access the connections on X.25 networks (lan interface). If it is using AF_CCITT family. data's are directly sent from the application to the X.25 Packet Level (level 3) without passing through a TCP or UDP protocol.

Question 3:
Call's with x.25 specifications used for X.25 protocol to transfer data on x.25 networks.

Question 4:

Yes. It is correct. XOPEN_SOURCE_EXTENDED is set to 1 to get unix 95 calls on 10.10 versions.

Question 5:
HP-UX is allowing X.25 protocol data transfer over X.25 networks. Normal are using the Posix type. To use the X/open calls,we have to compile with that option.


Regards,
Muthukumar.
Easy to suggest when don't know about the problem!
shaick_1
Occasional Advisor

Re: system call standards

Some comments,

>Posix are using int accept(int s, void *addr, int *addrlen);

No, posix follow exactly same syntax of opengroup for socket calls.
Refer link,
http://www.opengroup.org/press/03nov03.htm
or
Unix n/w prog by Richard stevens.( page 25)

I agreed that default call use Posix/Open standard prototype. But I guess if the source include file. If the source does include this header but user wants X/open standard then it needs to compile with -DXOPEN_SOURCE_EXTENDED flag.

Need to verify my second point.

Thanks for your comment.

Regards,
Shaick.