[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Comment on glibc2.28: Re: [PATCH glibc] Add file record locking supp
From: |
Samuel Thibault |
Subject: |
Re: Comment on glibc2.28: Re: [PATCH glibc] Add file record locking support |
Date: |
Sat, 1 Dec 2018 19:30:56 +0100 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
I forgot here:
Samuel Thibault, le sam. 01 déc. 2018 18:59:48 +0100, a ecrit:
> case F_GETLK:
> case F_SETLK:
> case F_SETLKW:
> {
> struct flock *fl = va_arg (ap, struct flock *);
> struct flock64 fl64 = {
> .l_type = fl->l_type,
> .l_whence = fl->l_whence,
> etc.
> };
>
> err = HURD_FD_PORT_USE (d, __file_record_lock (port, cmd, &fl64));
> result = err ? __hurd_dfail(fd, err) : 0;
When successful, the content of fl64.l_* should be copied into fl->l_*.
Additionally, for l_start and l_len, after copying, compare e.g.
fl64.l_start vs fl->l_start to check that it wasn't truncated. If that
fails, set the EOVERFLOW error. See sysdeps/mach/hurd/xstatconv.c for an
instance.
> break;
> }
Samuel