Linux相当于GetCommandLine和CommandLineToArgv?

前端之家收集整理的这篇文章主要介绍了Linux相当于GetCommandLine和CommandLineToArgv?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我想知道是否有一些API来获取 Linux上当前进程的命令行参数.

我想我非常不清楚.问题的真正目的是通过命令行参数传递unicode文件名.

解决方法

文件/ proc / self / cmdline中读取

例如:

@H_403_10@[wallyk@zf ~]$od -a /proc/30651/cmdline 0000000 / u s r / s b i n / h t t p d nul 0000020

或者,为了令人满意的令人耳目一新的自我参考:

@H_403_10@[wally@zf images]$od -c /proc/self/cmdline 0000000 o d \0 - c \0 / p r o c / s e l f 0000020 / c m d l i n e \0 0000031

猜你在找的Linux相关文章