Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Sep 2020 13:49:19 +0000
From:      "Wall, Stephen" <stephen.wall@redcom.com>
To:        Rick Macklem <rmacklem@uoguelph.ca>, FreeBSD Hackers <freebsd-hackers@freebsd.org>, "freebsd-current@freebsd.org" <freebsd-current@freebsd.org>
Subject:   Re: RFC: should copy_file_range(2) remain Linux compatible or support special files?
Message-ID:  <MN2PR09MB487615BB0445AA7F9BC91066EE340@MN2PR09MB4876.namprd09.prod.outlook.com>
In-Reply-To: <YTBPR01MB39663AB569A9B0EB8FF889F7DD340@YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM>
References:  <YTBPR01MB3966966F82008C9E471708FCDD370@YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM>, <MN2PR09MB4876F76163F8DA9276486AF9EE340@MN2PR09MB4876.namprd09.prod.outlook.com>, <YTBPR01MB39663AB569A9B0EB8FF889F7DD340@YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM>

index | next in thread | previous in thread | raw e-mail


> I'll assume you are referring to the "flags" argument when you say "param" above.

Correct, I was misremembering the man page.

> However, since the Linux man page says it will return EINVAL if
> the "flags" argument is non-zero, you've still introduced an incompatibility
> w.r.t. the Linux behaviour.

This would be a one-way incompatibility, i.e. code written on linux will run unaltered on FreeBSD.
If the flag were along the lines of `FREEBSD_COPY_DEVICES` (or whatever, important part is `FREEBSD`) it will be quite obvious that this code needs to be adapted to other platforms:
```
#ifndef FREEBSD_COPY_DEVICES
#define FREEBSD_COPY_DEVICES 0
#endif
```

> Why require extra work for so little purpose?

I'm sorry, I'm not sure what extra work you are referring to.  Specifying a flag on copy_file_range(2)?  That's trivial.

> My opinion is that if we can make it work for character devices, we should. 

Well, collecting opinions was the point, no? :)

What's going to use this function besides system commands?  I think I saw `cp` and `dd` mentioned - I think it unlikely you need to be concerned about their portability.

-spw



help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?MN2PR09MB487615BB0445AA7F9BC91066EE340>