<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libprocstat, branch release/10.1.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=release%2F10.1.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=release%2F10.1.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2014-03-19T23:55:03Z</updated>
<entry>
<title>MFC r260150: MFV r259170:</title>
<updated>2014-03-19T23:55:03Z</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2014-03-19T23:55:03Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=dafc93e37c0344865c370370a5a5d35eb186505f'/>
<id>urn:sha1:dafc93e37c0344865c370370a5a5d35eb186505f</id>
<content type='text'>
4370 avoid transmitting holes during zfs send

4371 DMU code clean up

illumos/illumos-gate@43466aae47bfcd2ad9bf501faec8e75c08095e4f

NOTE: Make sure the boot code is updated if a zpool upgrade is
done on boot zpool.
</content>
</entry>
<entry>
<title>Merge r262690 from head to stable/10:</title>
<updated>2014-03-09T13:23:49Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2014-03-09T13:23:49Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=67a9ab673a6ed4ecf4e6ed0ac899198f7f8eb545'/>
<id>urn:sha1:67a9ab673a6ed4ecf4e6ed0ac899198f7f8eb545</id>
<content type='text'>
  When querying a process's umask via sysctl in libprocstat(), don't
  print a warning if EPERM is returned as this is an expected failure
  mode rather than error -- similar to current handling of ESRCH.
  This makes the output of 'procstat -as' vastly more palatable.

  Sponsored by: DARPA, AFRL
</content>
</entry>
<entry>
<title>Handle the cases where NULL is passed as cap_rightsp to the</title>
<updated>2013-10-09T20:58:50Z</updated>
<author>
<name>Pawel Jakub Dawidek</name>
<email>pjd@FreeBSD.org</email>
</author>
<published>2013-10-09T20:58:50Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=772f66457abf8907811c63af06afe7c7faac7d77'/>
<id>urn:sha1:772f66457abf8907811c63af06afe7c7faac7d77</id>
<content type='text'>
filestat_new_entry() function.

Reported by:	Alex Kozlov &lt;spam@rm-rf.kiev.ua&gt;
Approved by:	re (gjb)
</content>
</entry>
<entry>
<title>Change the cap_rights_t type from uint64_t to a structure that we can extend</title>
<updated>2013-09-05T00:09:56Z</updated>
<author>
<name>Pawel Jakub Dawidek</name>
<email>pjd@FreeBSD.org</email>
</author>
<published>2013-09-05T00:09:56Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7008be5bd7341259037f383434a72960413cfeb8'/>
<id>urn:sha1:7008be5bd7341259037f383434a72960413cfeb8</id>
<content type='text'>
in the future in a backward compatible (API and ABI) way.

The cap_rights_t represents capability rights. We used to use one bit to
represent one right, but we are running out of spare bits. Currently the new
structure provides place for 114 rights (so 50 more than the previous
cap_rights_t), but it is possible to grow the structure to hold at least 285
rights, although we can make it even larger if 285 rights won't be enough.

The structure definition looks like this:

	struct cap_rights {
		uint64_t	cr_rights[CAP_RIGHTS_VERSION + 2];
	};

The initial CAP_RIGHTS_VERSION is 0.

The top two bits in the first element of the cr_rights[] array contain total
number of elements in the array - 2. This means if those two bits are equal to
0, we have 2 array elements.

The top two bits in all remaining array elements should be 0.
The next five bits in all array elements contain array index. Only one bit is
used and bit position in this five-bits range defines array index. This means
there can be at most five array elements in the future.

To define new right the CAPRIGHT() macro must be used. The macro takes two
arguments - an array index and a bit to set, eg.

	#define	CAP_PDKILL	CAPRIGHT(1, 0x0000000000000800ULL)

We still support aliases that combine few rights, but the rights have to belong
to the same array element, eg:

	#define	CAP_LOOKUP	CAPRIGHT(0, 0x0000000000000400ULL)
	#define	CAP_FCHMOD	CAPRIGHT(0, 0x0000000000002000ULL)

	#define	CAP_FCHMODAT	(CAP_FCHMOD | CAP_LOOKUP)

There is new API to manage the new cap_rights_t structure:

	cap_rights_t *cap_rights_init(cap_rights_t *rights, ...);
	void cap_rights_set(cap_rights_t *rights, ...);
	void cap_rights_clear(cap_rights_t *rights, ...);
	bool cap_rights_is_set(const cap_rights_t *rights, ...);

	bool cap_rights_is_valid(const cap_rights_t *rights);
	void cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src);
	void cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src);
	bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little);

Capability rights to the cap_rights_init(), cap_rights_set(),
cap_rights_clear() and cap_rights_is_set() functions are provided by
separating them with commas, eg:

	cap_rights_t rights;

	cap_rights_init(&amp;rights, CAP_READ, CAP_WRITE, CAP_FSTAT);

There is no need to terminate the list of rights, as those functions are
actually macros that take care of the termination, eg:

	#define	cap_rights_set(rights, ...)				\
		__cap_rights_set((rights), __VA_ARGS__, 0ULL)
	void __cap_rights_set(cap_rights_t *rights, ...);

Thanks to using one bit as an array index we can assert in those functions that
there are no two rights belonging to different array elements provided
together. For example this is illegal and will be detected, because CAP_LOOKUP
belongs to element 0 and CAP_PDKILL to element 1:

	cap_rights_init(&amp;rights, CAP_LOOKUP | CAP_PDKILL);

Providing several rights that belongs to the same array's element this way is
correct, but is not advised. It should only be used for aliases definition.

This commit also breaks compatibility with some existing Capsicum system calls,
but I see no other way to do that. This should be fine as Capsicum is still
experimental and this change is not going to 9.x.

Sponsored by:	The FreeBSD Foundation
</content>
</entry>
<entry>
<title>- Trim an unused and bogus Makefile for mount_smbfs.</title>
<updated>2013-06-28T21:00:08Z</updated>
<author>
<name>Davide Italiano</name>
<email>davide@FreeBSD.org</email>
</author>
<published>2013-06-28T21:00:08Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=237abf0c56afd2f4846230b70b42b4c3d02d2d19'/>
<id>urn:sha1:237abf0c56afd2f4846230b70b42b4c3d02d2d19</id>
<content type='text'>
- Reconnect with some minor modifications, in particular now selsocket()
internals are adapted to use sbintime units after recent'ish calloutng
switch.
</content>
</entry>
<entry>
<title>Borrow the algorithm from kvm_getprocs() to fix procstat_getprocs() to</title>
<updated>2013-06-11T20:00:49Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2013-06-11T20:00:49Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=608203fd94e4558b9dd9073545871adeabd63650'/>
<id>urn:sha1:608203fd94e4558b9dd9073545871adeabd63650</id>
<content type='text'>
handle the case where the process tables grows in between the calls to
fetch the size and fetch the table.

MFC after:	1 week
</content>
</entry>
<entry>
<title>Make errbuf optional, so if a caller is not interested in an error</title>
<updated>2013-05-08T19:11:47Z</updated>
<author>
<name>Mikolaj Golub</name>
<email>trociny@FreeBSD.org</email>
</author>
<published>2013-05-08T19:11:47Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=467112b4d10e4aa4a63fd9ec81c2e155e0f68a7f'/>
<id>urn:sha1:467112b4d10e4aa4a63fd9ec81c2e155e0f68a7f</id>
<content type='text'>
message she can pass NULL (procstat(1) already does this).

MFC after:	2 weeks
</content>
</entry>
<entry>
<title>Bump date.</title>
<updated>2013-05-04T12:44:00Z</updated>
<author>
<name>Sergey Kandaurov</name>
<email>pluknet@FreeBSD.org</email>
</author>
<published>2013-05-04T12:44:00Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f45590da3177703edc1ef5ababb3b980c52cc38c'/>
<id>urn:sha1:f45590da3177703edc1ef5ababb3b980c52cc38c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Similar to 233760 and 236717, export some more useful info about the</title>
<updated>2013-05-03T21:11:57Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2013-05-03T21:11:57Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=958aa57537952c7e7018518bb9d643b81e85e827'/>
<id>urn:sha1:958aa57537952c7e7018518bb9d643b81e85e827</id>
<content type='text'>
kernel-based POSIX semaphore descriptors to userland via procstat(1) and
fstat(1):
- Change sem file descriptors to track the pathname they are associated
  with and add a ksem_info() method to copy the path out to a
  caller-supplied buffer.
- Use the fo_stat() method of shared memory objects and ksem_info() to
  export the path, mode, and value of a semaphore via struct kinfo_file.
- Add a struct semstat to the libprocstat(3) interface along with a
  procstat_get_sem_info() to export the mode and value of a semaphore.
- Teach fstat about semaphores and to display their path, mode, and value.

MFC after:	2 weeks
</content>
</entry>
<entry>
<title>procstat_getpathname: for kvm method, instead of returning the error</title>
<updated>2013-05-01T15:02:58Z</updated>
<author>
<name>Mikolaj Golub</name>
<email>trociny@FreeBSD.org</email>
</author>
<published>2013-05-01T15:02:58Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=dd70ad64bf8714ba3e6ce0df49ced3e58014cb67'/>
<id>urn:sha1:dd70ad64bf8714ba3e6ce0df49ced3e58014cb67</id>
<content type='text'>
that the method is not supported, return an empty string.

This looks more handy for callers like procstat(1), which will not
abort after the failed call and still output some useful information.

MFC after:	3 weeks
</content>
</entry>
</feed>
