site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=1NvY5iMQVvbATaubT9105HwNmHyOYTOD7C/SH8F8Olo=; b=XQWNmJG7aPbvUgiaPpuHjXgy3huUnEU67iZWjro5je2X0wisdnUNEv5byiLTov83Cc rfzzp8h/gEIYKMyJnsrFiCEqypjrVByzTwpMHo1bd6mwm6xSBs6qpFJOgA3CWhs3SpUp OOfVASyGhn65miD/1q9RWWMVQphRX2727rfmk= Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=YNWvIs02lAHGWrkKdKSEE6JCzyGoe/FlkDvkuTnFZLnnPk7NqNNF1vjhXL5TCfRr0Y iKaiP/bOEdDK81VmWUZ2ABduZy1mJJLoXkaMR6bi7z0GB4uCgJVQGdLZ+JKOP71sskwy fl/ej1JUiP/NLZJaFPHGk/vn3ON3kUduWb43s= Hi list, I'm one of the Netatalk developers. We're in the process of implementing EA support. Earlier this year I implemented EA support using native ZFS EAs as a backend, still in the 10.5 timeframe. I tested for the greatest possible EA size (for non ressource forks obviously) with a small programm that drove setxattr with files on a local HFS+ like this: ---8<--- #include <unistd.h> #include <sys/xattr.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> int main(int argc, char **argv) { int ret; size_t size; char *buf; if (argc != 4) { printf("Usage: nattr <filename> <EAname> <size>\n"); exit(EXIT_FAILURE); } size = strtoul(argv[3], NULL, 10); if ( ! (buf = malloc(size)) ) { perror("malloc"); exit(EXIT_FAILURE); } ret = setxattr(argv[1], argv[2], buf, size, 0, XATTR_CREATE); if (ret && errno == EEXIST) ret = setxattr(argv[1], argv[2], buf, size, 0, XATTR_REPLACE); if (ret) printf("setxattr error: %s.errno: %u\n", strerror(errno), errno ); return ret; } ---8<--- This gave me 3802. In 10.6 I still get the same result. 3803 results in E2BIG. But: a fellow developer turned up sth. in xnu which seem to suggest that some layers in xnu regard the maximum size as:
http://opensource.apple.com/source/xnu/xnu-1228.15.4/bsd/hfs/hfs_xattr.c
#define HFS_MAXATTRIBUTESIZE (128 * 1024)
http://opensource.apple.com/source/xnu/xnu-1228.15.4/bsd/vfs/vfs_xattr.c
#define ATTR_MAX_SIZE (128*1024) /* 128K maximum attribute data size */
Better safe then sorry, so can anybody tell us what is a reliable maximum size ? Thanks! -Frank _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Frank Lahm