Sun Microsystems’ losses narrow