Thu Mar 28 08:24:39 2024
EVENTS
 FREE
SOFTWARE
INSTITUTE

POLITICS
JOBS
MEMBERS'
CORNER

MAILING
LIST

NYLXS Mailing Lists and Archives
NYLXS Members have a lot to say and share but we don't keep many secrets. Join the Hangout Mailing List and say your peice.

DATE 2015-06-01

LEARN

2024-03-28 | 2024-02-28 | 2024-01-28 | 2023-12-28 | 2023-11-28 | 2023-10-28 | 2023-09-28 | 2023-08-28 | 2023-07-28 | 2023-06-28 | 2023-05-28 | 2023-04-28 | 2023-03-28 | 2023-02-28 | 2023-01-28 | 2022-12-28 | 2022-11-28 | 2022-10-28 | 2022-09-28 | 2022-08-28 | 2022-07-28 | 2022-06-28 | 2022-05-28 | 2022-04-28 | 2022-03-28 | 2022-02-28 | 2022-01-28 | 2021-12-28 | 2021-11-28 | 2021-10-28 | 2021-09-28 | 2021-08-28 | 2021-07-28 | 2021-06-28 | 2021-05-28 | 2021-04-28 | 2021-03-28 | 2021-02-28 | 2021-01-28 | 2020-12-28 | 2020-11-28 | 2020-10-28 | 2020-09-28 | 2020-08-28 | 2020-07-28 | 2020-06-28 | 2020-05-28 | 2020-04-28 | 2020-03-28 | 2020-02-28 | 2020-01-28 | 2019-12-28 | 2019-11-28 | 2019-10-28 | 2019-09-28 | 2019-08-28 | 2019-07-28 | 2019-06-28 | 2019-05-28 | 2019-04-28 | 2019-03-28 | 2019-02-28 | 2019-01-28 | 2018-12-28 | 2018-11-28 | 2018-10-28 | 2018-09-28 | 2018-08-28 | 2018-07-28 | 2018-06-28 | 2018-05-28 | 2018-04-28 | 2018-03-28 | 2018-02-28 | 2018-01-28 | 2017-12-28 | 2017-11-28 | 2017-10-28 | 2017-09-28 | 2017-08-28 | 2017-07-28 | 2017-06-28 | 2017-05-28 | 2017-04-28 | 2017-03-28 | 2017-02-28 | 2017-01-28 | 2016-12-28 | 2016-11-28 | 2016-10-28 | 2016-09-28 | 2016-08-28 | 2016-07-28 | 2016-06-28 | 2016-05-28 | 2016-04-28 | 2016-03-28 | 2016-02-28 | 2016-01-28 | 2015-12-28 | 2015-11-28 | 2015-10-28 | 2015-09-28 | 2015-08-28 | 2015-07-28 | 2015-06-28 | 2015-05-28 | 2015-04-28 | 2015-03-28 | 2015-02-28 | 2015-01-28 | 2014-12-28 | 2014-11-28 | 2014-10-28

Key: Value:

Key: Value:

MESSAGE
DATE 2015-06-26
FROM Ruben Safir
SUBJECT Subject: [LIU Comp Sci] Fwd: strange function types in unistd.h
From owner-learn-outgoing-at-mrbrklyn.com Fri Jun 26 18:24:36 2015
Return-Path:
X-Original-To: archive-at-mrbrklyn.com
Delivered-To: archive-at-mrbrklyn.com
Received: by mrbrklyn.com (Postfix)
id B1FB616117E; Fri, 26 Jun 2015 18:24:36 -0400 (EDT)
Delivered-To: learn-outgoing-at-mrbrklyn.com
Received: by mrbrklyn.com (Postfix, from userid 28)
id 93FEB161182; Fri, 26 Jun 2015 18:24:36 -0400 (EDT)
Delivered-To: learn-at-nylxs.com
Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89])
by mrbrklyn.com (Postfix) with ESMTP id C273916117E;
Fri, 26 Jun 2015 18:24:09 -0400 (EDT)
Received: from [10.0.0.19] (www.mrbrklyn.com [96.57.23.82])
by mailbackend.panix.com (Postfix) with ESMTPSA id 6D9BF13C67;
Fri, 26 Jun 2015 18:24:09 -0400 (EDT)
Message-ID: <558DD109.9090407-at-panix.com>
Date: Fri, 26 Jun 2015 18:24:09 -0400
From: Ruben Safir
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
MIME-Version: 1.0
To: Hangout , learn-at-nylxs.com
Subject: [LIU Comp Sci] Fwd: strange function types in unistd.h
References: <2pumoado7dtlvqaujvgq58gup7c2m73rmq-at-4ax.com>
In-Reply-To:
X-Forwarded-Message-Id: <2pumoado7dtlvqaujvgq58gup7c2m73rmq-at-4ax.com>
Content-Type: multipart/mixed;
boundary="------------020509010101040605070305"
Sender: owner-learn-at-mrbrklyn.com
Precedence: bulk
Reply-To: learn-at-mrbrklyn.com

This is a multi-part message in MIME format.
--------------020509010101040605070305
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

Just something worth bringing to your attention and for learning about
advanced C programming in Unix and GCC


--------------020509010101040605070305
Content-Type: message/rfc822;
name="strange function types in unistd_h.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="strange function types in unistd_h.eml"

Path: reader1.panix.com!panix!not-for-mail
From: ruben safir
Newsgroups: comp.unix.programmer
Subject: strange function types in unistd.h
Date: Wed, 24 Jun 2015 23:39:08 -0400
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID:
NNTP-Posting-Host: www.mrbrklyn.com
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: reader1.panix.com 1435203548 28127 96.57.23.82 (25 Jun 2015 03:39:08 GMT)
X-Complaints-To: abuse-at-panix.com
NNTP-Posting-Date: Thu, 25 Jun 2015 03:39:08 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
Xref: panix comp.unix.programmer:234761

Can someone walk me through the exact meaning of this line


279 /* Values for the second argument to access.
280 These may be OR'd together. */
281 #define R_OK 4 /* Test for read permission. */
282 #define W_OK 2 /* Test for write permission. */
283 #define X_OK 1 /* Test for execute permission. */
284 #define F_OK 0 /* Test for existence. */
285
286 /* Test for access to NAME using the real UID and real GID. */
287 extern int access (const char *__name, int __type) __THROW
__nonnull ((1));
288



287 - throw and nonnul? I'm not familiar with this C syntax


Ruben


--------------020509010101040605070305
Content-Type: message/rfc822;
name="Re: strange function types in unistd_h.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: strange function types in unistd_h.eml"

Path: reader1.panix.com!panix!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From: Barry Schwarz
Newsgroups: comp.unix.programmer
Subject: Re: strange function types in unistd.h
Date: Wed, 24 Jun 2015 21:00:59 -0700
Organization: A noiseless patient Spider
Message-ID: <2pumoado7dtlvqaujvgq58gup7c2m73rmq-at-4ax.com>
References:
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: mx02.eternal-september.org; posting-host="1778e2eb2af8532fd406f5566d5298e8";
logging-data="29794"; mail-complaints-to="abuse-at-eternal-september.org"; posting-account="U2FsdGVkX19wFc9wriYPjpkh2Mho5fCmylful3xF7tw="
X-Newsreader: Forte Agent 4.2/32.1118
Cancel-Lock: sha1:i8AhyRRjbCh01HQNbh1dF4F1jww=
Xref: panix comp.unix.programmer:234762

On Wed, 24 Jun 2015 23:39:08 -0400, ruben safir
wrote:

>Can someone walk me through the exact meaning of this line
>
>
> 279 /* Values for the second argument to access.
> 280 These may be OR'd together. */
> 281 #define R_OK 4 /* Test for read permission. */
> 282 #define W_OK 2 /* Test for write permission. */
> 283 #define X_OK 1 /* Test for execute permission. */
> 284 #define F_OK 0 /* Test for existence. */
> 285
> 286 /* Test for access to NAME using the real UID and real GID. */
> 287 extern int access (const char *__name, int __type) __THROW
>__nonnull ((1));
> 288
>
>287 - throw and nonnul? I'm not familiar with this C syntax

C is case sensitive and the underscores are part of the tokens. So it
is __THROW and __nonnull (with two ells).

The standard reserves tokens starting with two underscores for
extensions provided by the implementation. These fit that definition.

Just as a guess, it appears that __nonull directs the compiler to
generate some additional code when the function named access is
called. This code would verify that argument 1 is not NULL. __THROW
probably identifies the action if the verification fails.

--
Remove del for email

--------------020509010101040605070305
Content-Type: message/rfc822;
name="Re: strange function types in unistd_h.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: strange function types in unistd_h.eml"

Path: reader1.panix.com!panix!not-for-mail
From: ruben safir
Newsgroups: comp.unix.programmer
Subject: Re: strange function types in unistd.h
Date: Thu, 25 Jun 2015 01:04:58 -0400
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID:
References: <2pumoado7dtlvqaujvgq58gup7c2m73rmq-at-4ax.com>
NNTP-Posting-Host: www.mrbrklyn.com
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
X-Trace: reader1.panix.com 1435208698 29192 96.57.23.82 (25 Jun 2015 05:04:58 GMT)
X-Complaints-To: abuse-at-panix.com
NNTP-Posting-Date: Thu, 25 Jun 2015 05:04:58 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
In-Reply-To: <2pumoado7dtlvqaujvgq58gup7c2m73rmq-at-4ax.com>
Xref: panix comp.unix.programmer:234763

On 06/25/2015 12:00 AM, Barry Schwarz wrote:
> The standard reserves tokens starting with two underscores for
> extensions provided by the implementation.


the implementation in this case is gcc?

--------------020509010101040605070305
Content-Type: message/rfc822;
name="Re: strange function types in unistd_h.eml"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
filename="Re: strange function types in unistd_h.eml"

Path: reader1.panix.com!panix!goblin2!goblin.stu.neva.ru!porbandar.httrack.net!montbard.httrack.net!news.httrack.net!.POSTED!not-for-mail
From: Xavier Roche
Newsgroups: comp.unix.programmer
Subject: Re: strange function types in unistd.h
Date: Thu, 25 Jun 2015 07:25:12 +0200
Organization: Nowhere Corp.
Message-ID:
References: <2pumoado7dtlvqaujvgq58gup7c2m73rmq-at-4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
X-Trace: news.httrack.net 1435209912 9205 2a00:4b00:13c:cc:5d61:8c47:d045:a92f (25 Jun 2015 05:25:12 GMT)
X-Complaints-To: usenet-at-httrack.com
NNTP-Posting-Date: Thu, 25 Jun 2015 05:25:12 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
In-Reply-To:
Xref: panix comp.unix.programmer:234764

Le 25/06/2015 07:04, ruben safir a ?crit :
> the implementation in this case is gcc?

Yes, mostly. __nonnull is just expanding to nonnull attributes

/usr/include/sys/cdefs.h:

#if __GNUC_PREREQ (3,3)
# define __nonnull(params) __attribute__ ((__nonnull__ params))
...

See

nonnull (arg-index, ...)
The nonnull attribute specifies that some function parameters should be non-null pointers. For instance, the declaration:
extern void *
my_memcpy (void *dest, const void *src, size_t len)
__attribute__((nonnull (1, 2)));

causes the compiler to check that, in calls to my_memcpy, arguments dest and src are non-null. If the compiler determines that a null pointer is passed in an argument slot marked as non-null, and the -Wnonnull option is enabled, a warning is issued. The compiler may also choose to make optimizations based on the knowledge that certain function arguments will not be null.

If no argument index list is given to the nonnull attribute, all pointer arguments are marked as non-null. To illustrate, the following declaration is equivalent to the previous example:

extern void *
my_memcpy (void *dest, const void *src, size_t len)
__attribute__((nonnull));

[ Note on '__attribute__ ((__nonnull__' :

You may also specify attributes with `__' preceding and following each keyword. This allows you to use them in header files without being concerned about a possible macro of the same name. For example, you may use __noreturn__ instead of noreturn. ]


--------------020509010101040605070305--

  1. 2015-06-01 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] Summer NYLXS Study Schedule
  2. 2015-06-01 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] Artifical Intelligence Workshop cancelled tonight for Space Program
  3. 2015-06-01 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] Logicworks
  4. 2015-06-02 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] 3d scanning and virtualization
  5. 2015-06-04 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] Linux Laptops cheap
  6. 2015-06-06 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] Brooklyn Press
  7. 2015-06-07 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] This weeks schedule
  8. 2015-06-10 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] Dynamic Network Stacks
  9. 2015-06-17 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] Programming and Design contest
  10. 2015-06-18 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] join me for school with a scholarship from the Linux foundation
  11. 2015-06-26 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] Fwd: strange function types in unistd.h

NYLXS are Do'ers and the first step of Doing is Joining! Join NYLXS and make a difference in your community today!