Expose extern_proc's p_starttime to Swift

Originator:keithbsmiley
Number:rdar://31549450 Date Originated:10-Apr-2017 21:18
Status:Resolved Resolved:Xcode 9 beta 3 (9M174d)
Product:iOS + SDK Product Version:Version 8.3.1 (8E1000a)
Classification:Other Bug Reproducible:Always
 
Summary:
Currently if you'd like to access the start time for a process using sysctl in swift. You have to call sysctl, and with the output value, access the start time like this:

```
var processInfo = kinfo_proc()
...
let launchSeconds = processInfo.kp_proc.p_un.__p_starttime.tv_sec
let launchMicroseconds = processInfo.kp_proc.p_un.__p_starttime.tv_usec
```

In Objective-C there is a define like this:

```
#define p_starttime p_un.__p_starttime
```

It would be great if Swift could access this "more stable" identifier.

Steps to Reproduce:
1. Attempt to get the process start time

Expected Results:
You could do so with `processInfo.kp_proc.p_starttime.tv_sec`

Actual Results:
You have to access it through `p_un` like this: `processInfo.kp_proc.p_un.__p_starttime.tv_sec`

Version:
Version 8.3.1 (8E1000a)

Notes:
You can view the current interface of this type here: https://github.com/opensource-apple/xnu/blob/53c5e2e62fc4182595609153d4b99648da577c39/bsd/sys/proc.h#L96

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!