int sys_fsetxattr (int filedes, const char *name, const void *value, size_t size, int flags);
uint32_t unix_dev_major(SMB_DEV_T dev);
uint32_t unix_dev_minor(SMB_DEV_T dev);
+char *sys_realpath(const char *path);
#if 0
int sys_get_number_of_cores(void);
#endif
#endif
}
+/**************************************************************************
+ Wrapper for realpath.
+****************************************************************************/
+
+char *sys_realpath(const char *path)
+{
+ char *result;
+
+#ifdef REALPATH_TAKES_NULL
+ result = realpath(path, NULL);
+#else
+ result = SMB_MALLOC_ARRAY(char, PATH_MAX + 1);
+ if (result) {
+ char *resolved_path = realpath(path, result);
+ if (!resolved_path) {
+ SAFE_FREE(result);
+ } else {
+ /* SMB_ASSERT(result == resolved_path) ? */
+ result = resolved_path;
+ }
+ }
+#endif
+ return result;
+}
+
#if 0
/*******************************************************************
Return the number of CPUs.
char *result;
START_PROFILE(syscall_realpath);
-#ifdef REALPATH_TAKES_NULL
- result = realpath(path, NULL);
-#else
- result = SMB_MALLOC_ARRAY(char, PATH_MAX+1);
- if (result) {
- char *resolved_path = realpath(path, result);
- if (!resolved_path) {
- SAFE_FREE(result);
- } else {
- /* SMB_ASSERT(result == resolved_path) ? */
- result = resolved_path;
- }
- }
-#endif
+ result = sys_realpath(path);
END_PROFILE(syscall_realpath);
return result;
}