AIX



Hello,

I've been hacking gnome ( 2.8.0, using pkgsrc ( see http://www.pkgsrc.org ) ) for a while now and finally got it to work, although it required some hacking ( details follow )
My main work horse (or my favourite toy, depends how you see it)  is a Motorola PowerStack II, running AIX 4.3.2 - kind of an oddball UNIX, even slightly odd for an AIX. Most hacking had to be done in gnome-vfs2 - AIX support seems to be unfinished ( didn't compile for me, couldn't possibly work as it is ) and a bug in AIX prevented any network-related stuff from working.
Access to local files and http work now.

The AIX bug is this - getaddrinfo() works fine, but it doesn't fill the sa_family field in ai_addr in the returned structure ( it returns zero ) so vfs thinks the result is invalid. Simple remedy: copy the address family identifier from ai_family, so libgnomevfs/gnome-vfs-resolve.c would look like this:
...
gboolean
gnome_vfs_resolve_next_address (GnomeVFSResolveHandle  *handle,
						  GnomeVFSAddress       **address)
{
	   g_return_val_if_fail (address != NULL, FALSE);
	   g_return_val_if_fail (handle != NULL, FALSE);

	   *address = NULL;
#ifdef HAVE_GETADDRINFO   
	   while (*address == NULL && handle->current != NULL) 
	   {
	   		#ifdef _AIX
			/* getaddrinfo() on AIX 4.3.2 and probably others don't set sa_family in
			ai_addr so we have to copy it from ai_family */
			handle->current->ai_addr->sa_family=handle->current->ai_family;
			#endif
			*address = gnome_vfs_address_new_from_sockaddr (handle->current->ai_addr,
												    handle->current->ai_addrlen);
...
This allows the http module to work, ftp keeps trying to connect and seems to run into an endless loop, I'll investigate that later.

The other file that needed hacking is gnome-vfs-unix-mounts.c
Had to complete some unfinished code, now it compiles and apparently works although I'm not too sure of it. Here's the diff:
*** gnome-vfs-unix-mounts.c.orig        Mon Sep 13 02:33:37 2004
--- gnome-vfs-unix-mounts.c     Sat Oct 23 15:42:57 2004
***************
*** 382,387 ****
--- 382,388 ----
        struct vfs_ent *fs_info;
        struct vmount *vmount_info;
        int vmount_number;
+       GnomeVFSUnixMount *mount_entry;
        unsigned int vmount_size;
        int current;

***************
*** 493,498 ****
--- 494,501 ----
   * don't return swap and ignore mounts.
   */

+ #if !defined(_AIX)
+ /* need to disable this - AIX has its own get_fstab_file() */
  static char *
  get_fstab_file (void)
  {
***************
*** 505,510 ****
--- 508,515 ----
  #endif
  }

+ #endif /* AIX */
+
  #ifdef HAVE_MNTENT_H
  gboolean
  _gnome_vfs_get_unix_mount_table (GList **return_list)
***************
*** 785,797 ****
  _gnome_vfs_get_unix_mount_table (GList **return_list)
  {
        static time_t last_mtime = 0;
-       struct mntent *mntent;
        FILE *file;
        char *read_file;
        char *stat_file;
        struct stat sb;
        GnomeVFSUnixMountPoint *mount_entry;
!         MountTableEntry mntent;

        stat_file = read_file = get_fstab_file ();

--- 790,801 ----
  _gnome_vfs_get_unix_mount_table (GList **return_list)
  {
        static time_t last_mtime = 0;
        FILE *file;
        char *read_file;
        char *stat_file;
        struct stat sb;
        GnomeVFSUnixMountPoint *mount_entry;
!     AixMountTableEntry mntent;

        stat_file = read_file = get_fstab_file ();

***************
*** 815,826 ****
        }

        while (!aix_fs_get (file, &mntent)) {
!               if (strcmp ("cdrfs", ent->mnt_fstype) == 0) {
                        mount_entry = g_new0 (GnomeVFSUnixMountPoint, 1);

!                       mount_entry->mount_path = g_strdup (mntent->mnt_dir);
!                       mount_entry->device_path = g_strdup (mntent->mnt_fsname);
!                       mount_entry->filesystem_type = g_strdup (mntent->mnt_type);
                        mount_entry->is_read_only = TRUE;
                        mount_entry->is_user_mountable = TRUE;

--- 819,830 ----
        }

        while (!aix_fs_get (file, &mntent)) {
!               if (strcmp ("cdrfs", mntent.mnt_fstype) == 0) {
                        mount_entry = g_new0 (GnomeVFSUnixMountPoint, 1);

!                       mount_entry->mount_path = g_strdup (mntent.mnt_mount);
!                       mount_entry->device_path = g_strdup (mntent.mnt_special);
!                       mount_entry->filesystem_type = g_strdup (mntent.mnt_fstype);
                        mount_entry->is_read_only = TRUE;
                        mount_entry->is_user_mountable = TRUE;

It seems to work since nautilus finds my CDROM drive and it can access files on CDs. 

have fun
Michael



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]