New OS adapter burn_os_is_2k_seekrw() replaces S_ISBLK() with pseudo-drives

This commit is contained in:
2010-01-16 12:51:24 +00:00
parent 7ead54c8b9
commit 39fd8b922d
8 changed files with 224 additions and 35 deletions

View File

@ -206,6 +206,23 @@ int sg_is_enumerable_adr(char *adr)
}
/* Return 1 if the given path leads to a regular file or a device that can be
seeked, read, and possibly written with 2 kB granularity.
*/
int burn_os_is_2k_seekrw(char *path, int flag)
{
struct stat stbuf;
if (stat(path, &stbuf) == -1)
return 0;
if (S_ISREG(stbuf.st_mode))
return 1;
if (S_ISBLK(stbuf.st_mode))
return 1;
return 0;
}
/** Estimate the potential payload capacity of a file address.
@param path The address of the file to be examined. If it does not
exist yet, then the directory will be inquired.