dirent_buf_size change request to use DBusDirIter* instead of DIR *

Andrew Sherk ASherk at qnx.com
Wed Jan 7 09:50:32 PST 2009


Hello,

In dbus-sysdeps-util-unix.c, 
static dbus_bool_t dirent_buf_size(DIR * dirp, size_t *size)
function uses fpathconf to get the name_max

I would like to change this function to pass in a DBusDirIter* instead,
Then modify struct DBusDirIter to include a second member of type long
that would set this name_max value in _dbus_directory_open, by calling
pathconf like this:
	iter->name_max = pathconf(filename_c, _PC_NAME_MAX);

Reason:
In QNX 6.4.0, we can't get a file descriptor from a DIR* but we can get
the _PC_NAME_MAX limit if we have the path.  The only time we would
easily know this path is when _dbus_directory_open is called.

dirent_buf_size function is private to dbus-sysdeps-util-unix.c and is
only called by _dbus_directory_get_next_file, which simply passes
iter->d to dirent_bufsize.

This call could be changed from:
	dirent_buf_size(iter->d, &buf_size)
To:
	dirent_buf_size(iter, &buf_size)

and then we'd have a portable way of getting this value in QNX too.

What does everyone think of the change?


More information about the dbus mailing list