This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PowerPC64 - Fix INTERNAL_[V]SYSCALL_NCS macros to notcast return val to (int)


> Corrected the formatting.

Some of it is now correct, but plenty is still wrong.

> Fixed, though I have a question, what's the difference between
> UIO_MAXIOV and IOV_MAX?  POSIX specifies using IOV_MAX in the writev
> documentation but I used UIO_MAXIOV as you indicated.

IOV_MAX is the proper POSIX name.  Use that.

> /* writev should report that it has written EXPECTED number of bytes.  */
> #define EXPECTED ((ssize_t)INT32_MAX+1)

You can make this size_t and then use a cast on the return value to avoid
the compiler warning in the comparison.

> /* How big does each buffer have to be to fit EXPECTED into UIO_MAXIOV iovec
>  * structs?  We do this because not all systems will support an EXPECTED size
>  * malloc.  */
> const ssize_t bufsz = (EXPECTED / (UIO_MAXIOV - 1));
> 
> /* The last buffer is only partially full.  */
> const ssize_t bufrem = (EXPECTED % (UIO_MAXIOV - 1));

These should be size_t and there is no reason to make them globals.

Why - 1?


Thanks,
Roland


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]