From: Andrew Bell <andrew.bell.ia@gmail.com>
To: Peng Yu <pengyu.ut@gmail.com>
Cc: libc-help <libc-help@sourceware.org>
Subject: Re: Why is st_size defined as a signed int?
Date: Tue, 27 Apr 2021 13:05:45 -0400 [thread overview]
Message-ID: <CACJ51z0AexO4ZsKVbEwYB+737Pf4=bRHemx5FRHHRGDVumG5Og@mail.gmail.com> (raw)
In-Reply-To: <CABrM6wmmr_QU4Z=d8gsPMr812AWtgrf80kNs1+1Qezvn_0RN6A@mail.gmail.com>
On Tue, Apr 27, 2021 at 12:46 PM Peng Yu via Libc-help <
libc-help@sourceware.org> wrote:
> Hi,
>
> https://github.com/bminor/glibc/blob/master/bits/stat.h#L47
>
> I see st_size is defined as __off_t, which should be a signed int. But
> can a file size be negative. If not, why not use an unsigned int to
> represent the file size?
This is required by the POSIX standard.
--
Andrew Bell
andrew.bell.ia@gmail.com
prev parent reply other threads:[~2021-04-27 17:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-27 14:01 Peng Yu
2021-04-27 16:06 ` Mike Frysinger
2021-04-27 17:05 ` Andrew Bell [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CACJ51z0AexO4ZsKVbEwYB+737Pf4=bRHemx5FRHHRGDVumG5Og@mail.gmail.com' \
--to=andrew.bell.ia@gmail.com \
--cc=libc-help@sourceware.org \
--cc=pengyu.ut@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).