+ }
+ return err;
+}
+
+/* ---------------------------- */
+int afp_write(obj, ibuf, ibuflen, rbuf, rbuflen)
+AFPObj *obj;
+char *ibuf, *rbuf;
+int ibuflen, *rbuflen;
+{
+ return write_fork(obj, ibuf, ibuflen, rbuf, rbuflen, 0);
+}
+
+/* ----------------------------
+ * FIXME need to deal with SIGXFSZ signal
+*/
+int afp_write_ext(obj, ibuf, ibuflen, rbuf, rbuflen)
+AFPObj *obj;
+char *ibuf, *rbuf;
+int ibuflen, *rbuflen;
+{
+ return write_fork(obj, ibuf, ibuflen, rbuf, rbuflen, 1);
+}
+
+/* ---------------------------- */
+int afp_getforkparams(obj, ibuf, ibuflen, rbuf, rbuflen )
+AFPObj *obj _U_;
+char *ibuf, *rbuf;
+int ibuflen _U_, *rbuflen;
+{
+ struct ofork *ofork;
+ int buflen, ret;
+ u_int16_t ofrefnum, bitmap;
+ u_int16_t attrbits = 0;
+
+ ibuf += 2;
+ memcpy(&ofrefnum, ibuf, sizeof( ofrefnum ));
+ ibuf += sizeof( ofrefnum );
+ memcpy(&bitmap, ibuf, sizeof( bitmap ));
+ bitmap = ntohs( bitmap );
+ ibuf += sizeof( bitmap );
+
+ *rbuflen = 0;
+ if (NULL == ( ofork = of_find( ofrefnum )) ) {
+ LOG(log_error, logtype_afpd, "afp_getforkparams: of_find(%d) could not locate fork", ofrefnum );
+ return( AFPERR_PARAM );
+ }
+ attrbits = ((ofork->of_ad->ad_df.adf_refcount > 0) ? ATTRBIT_DOPEN : 0);
+ attrbits |= ((ofork->of_ad->ad_hf.adf_refcount > ofork->of_ad->ad_df.adf_refcount) ? ATTRBIT_ROPEN : 0);