Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1380590
| From | Al Viro <viro@ZenIV.linux.org.uk> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 0/7] IB/hfi1: Remove write() and use ioctl() for user access |
| Date | 2016-04-16 21:20 +0200 |
| Message-ID | <roDV8-50-23@gated-at.bofh.it> (permalink) |
| References | (5 earlier) <rofSN-6IB-3@gated-at.bofh.it> <rofSN-6IB-1@gated-at.bofh.it> <rojto-15l-15@gated-at.bofh.it> <rolvb-2z2-1@gated-at.bofh.it> <rorAD-7v4-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Sat, Apr 16, 2016 at 09:00:42AM +0300, Leon Romanovsky wrote:
> On Fri, Apr 15, 2016 at 05:37:32PM -0600, Jason Gunthorpe wrote:
> > On Sat, Apr 16, 2016 at 12:23:28AM +0300, Leon Romanovsky wrote:
> >
> > > Intel as usual decided to do it in their way and the result is presented
> > > on this mailing list.
> >
> > Dennis was pretty clear he was going to send the patches to address
> > Al's concern, which he has done.
> >
> > I was also pretty clear I was looking to get rid of the char dev :)
>
> Yes, and I was pretty clear that we need to converge on one common API
> prior to converting old code (including drivers in staging) in order to
> do it once only.
While we are at it, could the person who'd come up with ui_lseek() be located
and made to stand up and explain the rationale behind the SEEK_END semantics
therein? To quote the manpage (and paraphrase just about any introductory
textbook):
SEEK_END
The file offset is set to the size of the file plus offset bytes.
I'm really curious - which part of "plus" might have lead to
case SEEK_END:
offset = ((dd->kregend - dd->kregbase) + DC8051_DATA_MEM_SIZE) -
offset;
and, if its author has decided that of course it _must_ have meant "minus",
why had he or she failed to post a correction to the manpage? Or, on the
off-chance that this "plus" might have something to do with reality,
experimented with some file, for that matter.
Folks, this is a well-earned "F". And not just for Unix Programming 101 -
the same semantics applies to fseek(3), which is a part of C standard.
Incidentally, lseek(fd, 0, SEEK_END) is "seek to end", not "fail with EINVAL".
As for the use of ioctl... Frankly, considering the above, it does sound like
"that'll make them STFU about the weirdness - ioctl *is* weird, so there!"
Single-consumer APIs stink, film at 11...
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH 0/7] IB/hfi1: Remove write() and use ioctl() for user access Christoph Hellwig <hch@infradead.org> - 2016-04-15 19:40 +0200
RE: [PATCH 0/7] IB/hfi1: Remove write() and use ioctl() for user access "Hefty, Sean" <sean.hefty@intel.com> - 2016-04-15 19:50 +0200
RE: [PATCH 0/7] IB/hfi1: Remove write() and use ioctl() for user access "Woodruff, Robert J" <robert.j.woodruff@intel.com> - 2016-04-15 19:50 +0200
Re: [PATCH 0/7] IB/hfi1: Remove write() and use ioctl() for user access Leon Romanovsky <leon@leon.nu> - 2016-04-15 23:30 +0200
Re: [PATCH 0/7] IB/hfi1: Remove write() and use ioctl() for user access Leon Romanovsky <leon@leon.nu> - 2016-04-15 23:30 +0200
Re: [PATCH 0/7] IB/hfi1: Remove write() and use ioctl() for user access Ira Weiny <ira.weiny@intel.com> - 2016-04-16 01:30 +0200
Re: [PATCH 0/7] IB/hfi1: Remove write() and use ioctl() for user access Leon Romanovsky <leon@leon.nu> - 2016-04-16 08:20 +0200
Re: [PATCH 0/7] IB/hfi1: Remove write() and use ioctl() for user access Dennis Dalessandro <dennis.dalessandro@intel.com> - 2016-04-16 17:30 +0200
Re: [PATCH 0/7] IB/hfi1: Remove write() and use ioctl() for user access Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2016-04-16 01:40 +0200
Re: [PATCH 0/7] IB/hfi1: Remove write() and use ioctl() for user access Leon Romanovsky <leon@leon.nu> - 2016-04-16 08:10 +0200
Re: [PATCH 0/7] IB/hfi1: Remove write() and use ioctl() for user access Al Viro <viro@ZenIV.linux.org.uk> - 2016-04-16 21:20 +0200
Re: [PATCH 0/7] IB/hfi1: Remove write() and use ioctl() for user access Dennis Dalessandro <dennis.dalessandro@intel.com> - 2016-04-18 14:10 +0200
csiph-web