public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Cc: <libc-help@sourceware.org>
Subject: Re: question about prctl return value type
Date: Wed, 24 Jul 2019 10:48:00 -0000	[thread overview]
Message-ID: <87pnlzn1xs.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <5D382C5F.6020806@cn.fujitsu.com> (Yang Xu's message of "Wed, 24	Jul 2019 18:01:03 +0800")

* Yang Xu:

> Since kernel syscall use long value for return, why we set int in
> sys/prctl.h(glibc). as below:
>
> /include/sys/prctl.h
>
>    1 #ifndef _SYS_PRCTL_H
>    2 #include_next <sys/prctl.h>
>    3 
>    4 # ifndef _ISOMAC
>    5 
>    6 extern int __prctl (int __option, ...);
>    7 
>    8 # endif /* !_ISOMAC */
>    9 #endif

Note that the actual user-visible header is
sysdeps/unix/sysv/linux/sys/prctl.h, but it has the same issue.

> If we calling prctl(PR_SET_TIMERSLACK, ULONG_MAX) and then calling prctl(PR_GET_TIMERSLACK), the value
> will be truncated into INT_MAX(or convered into unsinged,it is UINT_MAX) on 64bit machine. Or, this is a 
> glibc limitation for prctl interfaces?

I think this is a glibc limitation/bug.  The return type should probably
be __register_t (a type that is currently woefully underused).  We
cannot simply change the return time because once applications are built
against the new prototype, we need to ensure that they also use the new
glibc.

Would you please file a bug for this?
<https://sourceware.org/bugzilla/> is our bug tracker.

Thanks,
Florian

  reply	other threads:[~2019-07-24 10:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-24 10:01 Yang Xu
2019-07-24 10:48 ` Florian Weimer [this message]
2019-07-25  7:53   ` Yang Xu

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=87pnlzn1xs.fsf@oldenburg2.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-help@sourceware.org \
    --cc=xuyang2018.jy@cn.fujitsu.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).