[CONPY-198] FreeBSD use of undeclared identifier 'CLOCK_MONOTONIC_RAW' Created: 2022-04-03  Updated: 2022-04-05

Status: Open
Project: MariaDB Connector/Python
Component/s: Installation
Affects Version/s: 1.0.10
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Lee Nelson Assignee: Georg Richter
Resolution: Unresolved Votes: 0
Labels: None
Environment:

FreeBSD 13.0 amd64


Attachments: Text File error.txt    
Python Version: 3.8.12

 Description   

Compilation fails with the following:
mariadb/mariadb_connection.c:655:27: error: use of undeclared identifier 'CLOCK_MONOTONIC_RAW'
clock_gettime(CLOCK_MONOTONIC_RAW, &self->last_used);

A google search found the same error in a similar environment in a completely different project:
https://github.com/basil00/reqrypt/issues/20

The solution there was to add the following:
#ifndef CLOCK_MONOTONIC_RAW
#define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
#endif



 Comments   
Comment by Lee Nelson [ 2022-04-03 ]

I tested minor version (ie 1.0.x) back to 1.0.0 and had the same result with each version.

Comment by Georg Richter [ 2022-04-03 ]

Thanks for filing this issue:

I think better way would be to move from CLOCK_MONOTONIC_RAW to CLOCK_MONOTONIC. At least this is the way in python kernel code.
I think it's ok, since we don't need hightime value precision when it comes up to reuse a pooled connection.

Generated at Thu Feb 08 03:30:59 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.