Re: [Linuxptp-devel] [PATCH] util: don't error out in posix_clock_open() if we can't determine PHC index

2021-11-17 Thread Richard Cochran
On Wed, Nov 17, 2021 at 08:54:40AM +, Geva, Erez wrote:
> Do you mean?
> https://pubs.opengroup.org/onlinepubs/009696799/functions/realpath.html
> https://man7.org/linux/man-pages/man3/realpath.3p.html
> https://man7.org/linux/man-pages/man3/realpath.3.html

Cool.  That was easy.  Anyone care to submit a patch?

Thanks,
Richard


___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] [PATCH] util: don't error out in posix_clock_open() if we can't determine PHC index

2021-11-17 Thread Geva, Erez
Do you mean?
https://pubs.opengroup.org/onlinepubs/009696799/functions/realpath.html
https://man7.org/linux/man-pages/man3/realpath.3p.html
https://man7.org/linux/man-pages/man3/realpath.3.html

-Original Message-
From: Richard Cochran  
Sent: Wednesday, 17 November 2021 05:23
To: Keller, Jacob E 
Cc: linuxptp-devel@lists.sourceforge.net; Ed Branch 
Subject: Re: [Linuxptp-devel] [PATCH] util: don't error out in 
posix_clock_open() if we can't determine PHC index

On Tue, Nov 16, 2021 at 10:09:59PM +, Keller, Jacob E wrote:
> Is it possible for us to resolve symlinks ourselves before attempting to 
> check its index value? That would be an added convenience for users.

Hm, is there a unix/stdlib C API for realpath?

If so, then yes.

(I haven't heard of such an API.)

Thanks,
Richard


___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Flinuxptp-develdata=04%7C01%7Cerez.geva.ext%40siemens.com%7C43612f87a8f44034b17508d9a9824e9c%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C637727199964074616%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000sdata=ml3ts%2BuweHdldzu2MPKUNRiAOsyGjC1tTMYorx3rIz8%3Dreserved=0


___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] [PATCH] util: don't error out in posix_clock_open() if we can't determine PHC index

2021-11-16 Thread Hal Murray
> Hm, is there a unix/stdlib C API for realpath?

My Linux man page says:

CONFORMING TO
   4.4BSD, POSIX.1-2001.

   POSIX.1-2001 says that the behavior if resolved_path is NULL is  imple-
   mentation-defined.   POSIX.1-2008  specifies  the behavior described in
   this page.


-- 
These are my opinions.  I hate spam.





___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] [PATCH] util: don't error out in posix_clock_open() if we can't determine PHC index

2021-11-16 Thread Richard Cochran
On Tue, Nov 16, 2021 at 10:09:59PM +, Keller, Jacob E wrote:
> Is it possible for us to resolve symlinks ourselves before attempting to 
> check its index value? That would be an added convenience for users.

Hm, is there a unix/stdlib C API for realpath?

If so, then yes.

(I haven't heard of such an API.)

Thanks,
Richard


___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] [PATCH] util: don't error out in posix_clock_open() if we can't determine PHC index

2021-11-16 Thread Keller, Jacob E



> -Original Message-
> From: Richard Cochran 
> Sent: Saturday, November 13, 2021 6:53 AM
> To: Vladimir Oltean 
> Cc: Ed Branch ; linuxptp-devel@lists.sourceforge.net
> Subject: Re: [Linuxptp-devel] [PATCH] util: don't error out in 
> posix_clock_open() if
> we can't determine PHC index
> 
> On Sat, Nov 13, 2021 at 06:22:34AM -0800, Richard Cochran wrote:
> > Indeed phc2sys is correct in requiring that the path to the PTP char
> > device be in the "/dev/ptpN" format.
> 
> If ever phc2sys accepted /dev/ptp_kvm or similar, that was simply a
> bug in phc2sys.
> 
> > The Debian KVM script is just plain wrong.
> 
> Or maybe not a bug, but still the script that invokes phc2sys should
> simply use `realpath /dev/ptp_kvm`
> 

Is it possible for us to resolve symlinks ourselves before attempting to check 
its index value? That would be an added convenience for users.

Thanks,
Jake


___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] [PATCH] util: don't error out in posix_clock_open() if we can't determine PHC index

2021-11-13 Thread Richard Cochran
On Sat, Nov 13, 2021 at 06:53:06AM -0800, Richard Cochran wrote:
> On Sat, Nov 13, 2021 at 06:22:34AM -0800, Richard Cochran wrote:
>  
> > The Debian KVM script is just plain wrong.
> 
> Or maybe not a bug, but still the script that invokes phc2sys should
> simply use `realpath /dev/ptp_kvm`

I meant to say, "Or maybe not wrong, but ..."


Thanks,
Richard


___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] [PATCH] util: don't error out in posix_clock_open() if we can't determine PHC index

2021-11-13 Thread Richard Cochran
On Sat, Nov 13, 2021 at 06:22:34AM -0800, Richard Cochran wrote:
> Indeed phc2sys is correct in requiring that the path to the PTP char
> device be in the "/dev/ptpN" format.

If ever phc2sys accepted /dev/ptp_kvm or similar, that was simply a
bug in phc2sys.
 
> The Debian KVM script is just plain wrong.

Or maybe not a bug, but still the script that invokes phc2sys should
simply use `realpath /dev/ptp_kvm`

Thanks,
Richard


___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] [PATCH] util: don't error out in posix_clock_open() if we can't determine PHC index

2021-11-13 Thread Richard Cochran
On Sat, Nov 13, 2021 at 03:31:27AM +0200, Vladimir Oltean wrote:

> Otherwise said, for phc2sys it is an actual regression to require that
> the path to the PTP char device be in the "/dev/ptpN" format.

As discussed on lkml/netdev, there is no reason to rename the clock
character devices.

Indeed phc2sys is correct in requiring that the path to the PTP char
device be in the "/dev/ptpN" format.

The Debian KVM script is just plain wrong.

Sorry,
Richard



___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel