Comments (12)
The information shown is actually part of the actual test suite, since we test the output of some functions. There are currently no uv functions to provide OS information, do you have something in mind? I have a vague recolection of someone also asking for this long time ago.
As for the format, I'd stick to good old plaintext :-)
from libuv.
I didn't really consider including functionality for os information in libuv, rather just fiddling with uname/similar output. If you/they paste full configure output some parts show up, but that's just hard to read.
from libuv.
Well, that's autoconf at work... We'd need something cross platform, and parsing uname
really isn't.
from libuv.
If we rely on autoconf we could "parse" its output (config.log)?
from libuv.
We don't rely on autoconf. That's one of the build systems, we also have GYP and on Windows / MinGW there is a dedicated Makefile.
from libuv.
@saghul, is this something you would still add to libuv? If so, I would take look.
from libuv.
I'm open to suggestions :-)
from libuv.
@saghul, I'm thinking something along the lines of uv_cpu_info_t, but for OS information.
typedef enum { android, aix, win, unix, darwin } uv_sys_kind_t;
typedef struct uv_kernel_version_s {
int major;
int minor;
int patch;
int build;
char* extra_string;
} uv_kernel_version_t;
typedef struct uv_os_info {
uv_sys_kind_t sys;
char* sysname_string; /* "Windows", "Android" etc. */
char* release_string; /* "Vista", "XP", "trusty" etc.*/
uv_kernel_version_t kernel_version; /* structure to allow testing the versions numerically */
} uv_os_info_t;
/* Retrieve OS information */
int uv_os_info(uv_os_info_t*);
/* Pretty print OS information */
int uv_strosinfo(char*, uv_os_info_t*);
(just as a quick sketch, I need to familiarize myself with the project more, but you get the idea)
It might make sense to return the kernel version in a struct. As for the implementation, GetVersion&friends on Windows, uname on posix-friendly systems, plus trying to read /etc/lsb-release or issue etc. files. (I think it would be nice if the implementation detected the distributions on *nix).
Is this something like what you had in mind?
from libuv.
@sztomi thios is good work, thanks! I'll need a few days to work through the mail pile, but this is a good start IMHO.
from libuv.
Need this feature thanks
from libuv.
@saghul cool, then I'll try to whip out an initial implementation on my fork and let you know here when I have something to show.
from libuv.
No follow-up, closing. Feel free to open a PR when ready.
from libuv.
Related Issues (20)
- test: udp_multicast_join, udp_multicast_join6 failed under loongarch64 HOT 3
- Abstract socket namespace not work for 1.48 HOT 4
- several tests ha failed HOT 4
- unix udp close crash HOT 9
- linux,udp: don't use sendmmsg for single datagrams
- bug in libuv io_uring causes incorrect event reports to epoll and busy loop HOT 14
- `-Wstringop-overread` warning with libuv v1.48.0 (`unix/tcp.c:295`) with IBM AT17.0 (GCC 13.2.1) HOT 3
- Mixed allocator usage with `realpath` HOT 2
- Test failure with 1.48.0 on OSX x86 HOT 10
- Bug in TCP keep-alive with unix socket
- MSVC compiler bug broke env_vars test in ASAN (x64 windows 2022+asan) HOT 4
- Additional Libuv Metrics HOT 2
- test: flaky fs_event_close_with_pending_event HOT 2
- _alloca Requested memory may have edge problems causing exceptions HOT 3
- multicast: The Android server(apk) doesn't always receive multicast messages from ubuntu.
- test,ci: flaky fs_event_error_reporting
- android: enable fdsan?
- Send udp broadcast to 255.255.255.255 cause permission denied error HOT 2
- macos: use absolute timeouts for condition variables HOT 1
- fs_event_watch_dir test fails on alpine 3.19 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libuv.